From: Wu Fengguang <fengguang.wu@intel.com>
To: Andrew Morton <akpm@linux-foundation.org>, Ingo Molnar <mingo@elte.hu>
Cc: Mel Gorman <mgorman@suse.de>,
Steven Rostedt <srostedt@redhat.com>,
Wu Fengguang <fengguang.wu@intel.com>,
Linux Memory Management List <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: [RFC][PATCH 3/7] tracing/mm: create trace_objects.c
Date: Mon, 29 Aug 2011 11:29:54 +0800 [thread overview]
Message-ID: <20110829034932.000999180@intel.com> (raw)
In-Reply-To: <20110829032951.677220552@intel.com>
[-- Attachment #1: trace-objects.patch --]
[-- Type: text/plain, Size: 3015 bytes --]
Code refactor: create trace_objects.c and move relevant code from trace_mm.c
CC: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
---
kernel/trace/Makefile | 1 +
kernel/trace/trace.h | 1 +
kernel/trace/trace_mm.c | 22 ----------------------
kernel/trace/trace_objects.c | 26 ++++++++++++++++++++++++++
4 files changed, 28 insertions(+), 22 deletions(-)
--- linux-mmotm.orig/kernel/trace/Makefile 2011-08-28 10:09:25.000000000 +0800
+++ linux-mmotm/kernel/trace/Makefile 2011-08-28 10:09:28.000000000 +0800
@@ -26,6 +26,7 @@ obj-$(CONFIG_RING_BUFFER) += ring_buffer
obj-$(CONFIG_RING_BUFFER_BENCHMARK) += ring_buffer_benchmark.o
obj-$(CONFIG_TRACING) += trace.o
+obj-$(CONFIG_TRACING) += trace_objects.o
obj-$(CONFIG_TRACING) += trace_output.o
obj-$(CONFIG_TRACING) += trace_stat.o
obj-$(CONFIG_TRACING) += trace_printk.o
--- linux-mmotm.orig/kernel/trace/trace.h 2011-08-28 10:09:25.000000000 +0800
+++ linux-mmotm/kernel/trace/trace.h 2011-08-28 10:09:28.000000000 +0800
@@ -318,6 +318,7 @@ struct dentry *trace_create_file(const c
const struct file_operations *fops);
struct dentry *tracing_init_dentry(void);
+struct dentry *trace_objects_dir(void);
struct ring_buffer_event;
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-mmotm/kernel/trace/trace_objects.c 2011-08-28 10:09:28.000000000 +0800
@@ -0,0 +1,26 @@
+#include <linux/debugfs.h>
+
+#include "trace.h"
+#include "trace_output.h"
+
+struct dentry *trace_objects_dir(void)
+{
+ static struct dentry *d_objects;
+ struct dentry *d_tracer;
+
+ if (d_objects)
+ return d_objects;
+
+ d_tracer = tracing_init_dentry();
+ if (!d_tracer)
+ return NULL;
+
+ d_objects = debugfs_create_dir("objects", d_tracer);
+ if (!d_objects)
+ pr_warning("Could not create debugfs "
+ "'objects' directory\n");
+
+ return d_objects;
+}
+
+
--- linux-mmotm.orig/kernel/trace/trace_mm.c 2011-08-28 10:09:27.000000000 +0800
+++ linux-mmotm/kernel/trace/trace_mm.c 2011-08-28 10:09:28.000000000 +0800
@@ -95,28 +95,6 @@ static const struct file_operations trac
.write = trace_mm_pfn_range_write,
};
-/* move this into trace_objects.c when that file is created */
-static struct dentry *trace_objects_dir(void)
-{
- static struct dentry *d_objects;
- struct dentry *d_tracer;
-
- if (d_objects)
- return d_objects;
-
- d_tracer = tracing_init_dentry();
- if (!d_tracer)
- return NULL;
-
- d_objects = debugfs_create_dir("objects", d_tracer);
- if (!d_objects)
- pr_warning("Could not create debugfs "
- "'objects' directory\n");
-
- return d_objects;
-}
-
-
static struct dentry *trace_objects_mm_dir(void)
{
static struct dentry *d_mm;
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-08-29 3:57 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-29 3:29 [RFC][PATCH 0/7] trace memory objects Wu Fengguang
2011-08-29 3:29 ` [RFC][PATCH 1/7] tracing/mm: add page frame snapshot trace Wu Fengguang
2011-08-29 3:29 ` Wu Fengguang
2011-08-29 3:29 ` [RFC][PATCH 2/7] tracing/mm: rename trigger file to dump-pfn Wu Fengguang
2011-08-29 3:29 ` Wu Fengguang
2011-08-29 3:29 ` [RFC][PATCH 3/7] tracing/mm: create trace_objects.c Wu Fengguang
2011-08-29 3:29 ` Wu Fengguang [this message]
2011-08-29 3:29 ` [RFC][PATCH 4/7] tracing/mm: dump more page frame information Wu Fengguang
2011-08-29 3:29 ` Wu Fengguang
2011-08-29 3:29 ` [RFC][PATCH 5/7] tracing/mm: accept echo-able input format for pfn range Wu Fengguang
2011-08-29 3:29 ` Wu Fengguang
2011-08-29 3:29 ` [RFC][PATCH 6/7] tracing/mm: add dump-file and dump-fs interfaces Wu Fengguang
2011-08-29 3:29 ` Wu Fengguang
2011-08-29 3:29 ` [RFC][PATCH 7/7] tracing/mm: add memcg field Wu Fengguang
2011-08-29 3:29 ` Wu Fengguang
2011-08-29 3:59 ` [RFC][PATCH 0/7] trace memory objects Wu Fengguang
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=20110829034932.000999180@intel.com \
--to=fengguang.wu@intel.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mingo@elte.hu \
--cc=srostedt@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox