lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 18 Feb 2013 21:52:06 -0500
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Namjae Jeon <linkinjeon@...il.com>
Cc:	jaegeuk.kim@...sung.com, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	linux-f2fs-devel@...ts.sourceforge.net,
	Namjae Jeon <namjae.jeon@...sung.com>,
	Pankaj Kumar <pankaj.km@...sung.com>
Subject: Re: [PATCH 2/8] f2fs: add tracepoints for inode operations

On Tue, 2013-02-19 at 11:33 +0900, Namjae Jeon wrote:
> From: Namjae Jeon <namjae.jeon@...sung.com>

> +TRACE_EVENT(f2fs_unlink_exit,
> +	TP_PROTO(struct dentry *dentry, int ret),
> +
> +	TP_ARGS(dentry, ret),
> +
> +	TP_STRUCT__entry(
> +		__field(ino_t,	ino)
> +		__field(dev_t,	dev)
> +		__field(int,	ret)
> +	),
> +
> +	TP_fast_assign(
> +		__entry->ino		= dentry->d_inode->i_ino;
> +		__entry->dev		= dentry->d_inode->i_sb->s_dev;
> +		__entry->ret		= ret;
> +	),
> +
> +	TP_printk("dev %d,%d ino %lu ret %d",
> +		  MAJOR(__entry->dev), MINOR(__entry->dev),
> +		  (unsigned long) __entry->ino,
> +		  __entry->ret)
> +);
> +
>  #endif /* _TRACE_F2FS_H */
>  
>   /* This part must be outside protection */

If at all possible, try to combine as many tracepoints as possible by a
class. A TRACE_EVENT() is really a DECLARE_EVENT_CLASS();
DEFINE_EVENT(); pair that totals about 5k per TRACE_EVENT(). The
DECLARE_EVENT_CLASS() being the majority of that. A DEFINE_EVENT() adds
approximately 250 bytes each. Thus, combining the above with the
TRACE_EVENT() from the previous patch:

+TRACE_EVENT(f2fs_sync_file_exit,
+       TP_PROTO(struct inode *inode, int ret),
+
+       TP_ARGS(inode, ret),
+
+       TP_STRUCT__entry(
+               __field(int,    ret)
+               __field(ino_t,  ino)
+               __field(dev_t,  dev)
+       ),
+
+       TP_fast_assign(
+               __entry->ret            = ret;
+               __entry->ino            = inode->i_ino;
+               __entry->dev            = inode->i_sb->s_dev;
+       ),
+
+       TP_printk("dev %d,%d ino %lu ret %d",
+                 MAJOR(__entry->dev), MINOR(__entry->dev),
+                 (unsigned long) __entry->ino,
+                 __entry->ret)
+);

into:

DECLARE_EVENT_CLASS(f2fs_dev_inode_ret,
       TP_PROTO(struct inode *inode, int ret),

       TP_ARGS(inode, ret),

       TP_STRUCT__entry(
               __field(int,    ret)
               __field(ino_t,  ino)
               __field(dev_t,  dev)
       ),

       TP_fast_assign(
               __entry->ret            = ret;
               __entry->ino            = inode->i_ino;
               __entry->dev            = inode->i_sb->s_dev;
       ),

       TP_printk("dev %d,%d ino %lu ret %d",
                 MAJOR(__entry->dev), MINOR(__entry->dev),
                 (unsigned long) __entry->ino,
                 __entry->ret)
);

DEFINE_EVENT(f2fs_sync_file_exit,
       TP_PROTO(struct inode *inode, int ret),
       TP_ARGS(inode, ret));

DEFINE_EVENT(f2fs_unlink_exit,
       TP_PROTO(struct inode *inode, int ret),
       TP_ARGS(inode, ret));

You can save ~4750 bytes. Note, you will need to pass the inode instead
of the dentry into f2fs_unlink_exit(), but you don't use the dentry
anyway.

-- Steve


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ