From: Eric Sandeen <sandeen@sandeen.net>
To: xfs-oss <xfs@oss.sgi.com>
Subject: [PATCH] make xfs stats Kconfigurable
Date: Sat, 18 Aug 2007 15:04:25 -0500 [thread overview]
Message-ID: <46C750C9.8040604@sandeen.net> (raw)
Hey guys, what do you think, is it worth doing this for when
space is tight:
xfs stats are already optional based on CONFIG_PROC_FS, and there
is already a (never-set) macro XFS_STATS_OFF which can turn them
off. Making it a configurable option, if I turn them off I can
get a little stack savings on x86, gcc 4.1:
xfs_attr_list -8
xfs_bmap_rtalloc -16
xfs_bmap_search_extents -8
xfs_buf_find +8 (not sure why)
xfs_iflush -4
xfs_imap -12
xfs_log_reserve -4
xfs_log_sync -8
It'd reduce the size of the binary a bit too.
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Index: linux-2.6.22.i386/fs/xfs/Kconfig
===================================================================
--- linux-2.6.22.i386.orig/fs/xfs/Kconfig
+++ linux-2.6.22.i386/fs/xfs/Kconfig
@@ -59,6 +59,17 @@ config XFS_POSIX_ACL
If you don't know what Access Control Lists are, say N.
+ config XFS_STATS
+ bool "XFS statistics"
+ depends on XFS_FS && PROC_FS
+ help
+ If you say Y here xfs will gather detailed statistics during
+ its operation, and present them in /proc/fs/xfs/stat and
+ (CONFIG_XFS_QUOTA is enabled) /proc/fs/xfs/xqmstat. Disabling
+ this will make the compiled code and stack usage slightly smaller.
+
+ If unsure, say Y.
+
config XFS_RT
bool "XFS Realtime subvolume support"
depends on XFS_FS
Index: linux-2.6.22.i386/fs/xfs/Makefile-linux-2.6
===================================================================
--- linux-2.6.22.i386.orig/fs/xfs/Makefile-linux-2.6
+++ linux-2.6.22.i386/fs/xfs/Makefile-linux-2.6
@@ -35,12 +35,12 @@ xfs-$(CONFIG_XFS_QUOTA) += $(addprefix
xfs_qm.o)
ifeq ($(CONFIG_XFS_QUOTA),y)
-xfs-$(CONFIG_PROC_FS) += quota/xfs_qm_stats.o
+xfs-$(CONFIG_XFS_STAT) += quota/xfs_qm_stats.o
endif
xfs-$(CONFIG_XFS_RT) += xfs_rtalloc.o
xfs-$(CONFIG_XFS_POSIX_ACL) += xfs_acl.o
-xfs-$(CONFIG_PROC_FS) += $(XFS_LINUX)/xfs_stats.o
+xfs-$(CONFIG_XFS_STATS) += $(XFS_LINUX)/xfs_stats.o
xfs-$(CONFIG_SYSCTL) += $(XFS_LINUX)/xfs_sysctl.o
xfs-$(CONFIG_COMPAT) += $(XFS_LINUX)/xfs_ioctl32.o
Index: linux-2.6.22.i386/fs/xfs/linux-2.6/xfs_stats.h
===================================================================
--- linux-2.6.22.i386.orig/fs/xfs/linux-2.6/xfs_stats.h
+++ linux-2.6.22.i386/fs/xfs/linux-2.6/xfs_stats.h
@@ -19,7 +19,7 @@
#define __XFS_STATS_H__
-#if defined(CONFIG_PROC_FS) && !defined(XFS_STATS_OFF)
+#if defined(CONFIG_XFS_STATS)
#include <linux/percpu.h>
@@ -137,8 +137,7 @@ DECLARE_PER_CPU(struct xfsstats, xfsstat
extern void xfs_init_procfs(void);
extern void xfs_cleanup_procfs(void);
-
-#else /* !CONFIG_PROC_FS */
+#else /* !CONFIG_XFS_STATS */
# define XFS_STATS_INC(count)
# define XFS_STATS_DEC(count)
@@ -147,6 +146,6 @@ extern void xfs_cleanup_procfs(void);
static __inline void xfs_init_procfs(void) { };
static __inline void xfs_cleanup_procfs(void) { };
-#endif /* !CONFIG_PROC_FS */
+#endif /* !CONFIG_XFS_STATS */
#endif /* __XFS_STATS_H__ */
Index: linux-2.6.22.i386/fs/xfs/linux-2.6/xfs_sysctl.c
===================================================================
--- linux-2.6.22.i386.orig/fs/xfs/linux-2.6/xfs_sysctl.c
+++ linux-2.6.22.i386/fs/xfs/linux-2.6/xfs_sysctl.c
@@ -21,7 +21,7 @@
static struct ctl_table_header *xfs_table_header;
-#ifdef CONFIG_PROC_FS
+#ifdef CONFIG_XFS_STATS
STATIC int
xfs_stats_clear_proc_handler(
ctl_table *ctl,
@@ -52,7 +52,7 @@ xfs_stats_clear_proc_handler(
return ret;
}
-#endif /* CONFIG_PROC_FS */
+#endif /* CONFIG_XFS_STATS */
static ctl_table xfs_table[] = {
{
@@ -222,7 +222,7 @@ static ctl_table xfs_table[] = {
.extra2 = &xfs_params.fstrm_timer.max,
},
/* please keep this the last entry */
-#ifdef CONFIG_PROC_FS
+#ifdef CONFIG_XFS_STATS
{
.ctl_name = XFS_STATS_CLEAR,
.procname = "stats_clear",
Index: linux-2.6.22.i386/fs/xfs/quota/xfs_qm_stats.h
===================================================================
--- linux-2.6.22.i386.orig/fs/xfs/quota/xfs_qm_stats.h
+++ linux-2.6.22.i386/fs/xfs/quota/xfs_qm_stats.h
@@ -18,7 +18,7 @@
#ifndef __XFS_QM_STATS_H__
#define __XFS_QM_STATS_H__
-#if defined(CONFIG_PROC_FS) && !defined(XFS_STATS_OFF)
+#ifdef CONFIG_XFS_STATS
/*
* XQM global statistics
next reply other threads:[~2007-08-18 20:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-18 20:04 Eric Sandeen [this message]
2007-08-19 17:21 ` [PATCH V2] make xfs stats Kconfigurable Eric Sandeen
2007-08-19 18:34 ` Eric Sandeen
2007-08-19 19:10 ` Christoph Hellwig
2007-08-19 19:13 ` Eric Sandeen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46C750C9.8040604@sandeen.net \
--to=sandeen@sandeen.net \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.