All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Revert "trace-cmd: Add function declaration to fix compile warning"
@ 2012-03-19 20:28 Vaibhav Nagarnaik
  2012-03-19 20:28 ` [PATCH 2/2] trace-cmd: Close the trace file descriptor Vaibhav Nagarnaik
  2012-05-21 14:14 ` [PATCH 1/2] Revert "trace-cmd: Add function declaration to fix compile warning" Steven Rostedt
  0 siblings, 2 replies; 4+ messages in thread
From: Vaibhav Nagarnaik @ 2012-03-19 20:28 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Justin Teravest, David Sharp, linux-kernel, Vaibhav Nagarnaik

This reverts commit 1fc4fb039bfa3f0358d7e9810de71c58a7b32b64.

Steven added commit ba911ea7fc1fdd13e3bce1b2001f5b432df8edae which does
exactly the same thing. Now we end up with a duplicate declaration of
the function trace_util_ftrace_options(). Reverting the commit gets rid
of the warning.

Signed-off-by: Vaibhav Nagarnaik <vnagarnaik@google.com>
---
 trace-cmd.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/trace-cmd.h b/trace-cmd.h
index 3f522ee..f904dc5 100644
--- a/trace-cmd.h
+++ b/trace-cmd.h
@@ -218,7 +218,6 @@ long tracecmd_flush_recording(struct tracecmd_recorder *recorder);
 /* --- Plugin handling --- */
 extern struct plugin_option trace_ftrace_options[];
 
-void trace_util_ftrace_options(void);
 void trace_util_add_option(const char *name, const char *val);
 void trace_util_load_plugins(struct pevent *pevent, const char *suffix,
 			     void (*load_plugin)(struct pevent *pevent,
-- 
1.7.7.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] trace-cmd: Close the trace file descriptor
  2012-03-19 20:28 [PATCH 1/2] Revert "trace-cmd: Add function declaration to fix compile warning" Vaibhav Nagarnaik
@ 2012-03-19 20:28 ` Vaibhav Nagarnaik
  2012-05-21 14:14 ` [PATCH 1/2] Revert "trace-cmd: Add function declaration to fix compile warning" Steven Rostedt
  1 sibling, 0 replies; 4+ messages in thread
From: Vaibhav Nagarnaik @ 2012-03-19 20:28 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Justin Teravest, David Sharp, linux-kernel, Vaibhav Nagarnaik

trace-cmd opens "trace_raw" file descriptor to splice data continuously
through it to the CPU files. This causes a lot of pages being allocated
for the splice interface in the kernel. After the recorder instance is
destroyed, it doesn't close the file descriptor causing many of the
pages to remain in the cache. This gives an invalid view of memory lying
around in cache.

In any case, it is a good practice for the applications to close all the
descriptors that are opened.

This patch closes the open file descriptor which is used in the splice()
call and updates the check for disk file descriptor when closing it.

Signed-off-by: Vaibhav Nagarnaik <vnagarnaik@google.com>
---
 trace-recorder.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/trace-recorder.c b/trace-recorder.c
index 4a01fb9..215affc 100644
--- a/trace-recorder.c
+++ b/trace-recorder.c
@@ -50,7 +50,10 @@ void tracecmd_free_recorder(struct tracecmd_recorder *recorder)
 	if (!recorder)
 		return;
 
-	if (recorder->fd)
+	if (recorder->trace_fd >= 0)
+		close(recorder->trace_fd);
+
+	if (recorder->fd >= 0)
 		close(recorder->fd);
 
 	free(recorder);
-- 
1.7.7.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] Revert "trace-cmd: Add function declaration to fix compile warning"
  2012-03-19 20:28 [PATCH 1/2] Revert "trace-cmd: Add function declaration to fix compile warning" Vaibhav Nagarnaik
  2012-03-19 20:28 ` [PATCH 2/2] trace-cmd: Close the trace file descriptor Vaibhav Nagarnaik
@ 2012-05-21 14:14 ` Steven Rostedt
  2012-05-21 17:33   ` Vaibhav Nagarnaik
  1 sibling, 1 reply; 4+ messages in thread
From: Steven Rostedt @ 2012-05-21 14:14 UTC (permalink / raw)
  To: Vaibhav Nagarnaik; +Cc: Justin Teravest, David Sharp, linux-kernel

On Mon, 2012-03-19 at 13:28 -0700, Vaibhav Nagarnaik wrote:
> This reverts commit 1fc4fb039bfa3f0358d7e9810de71c58a7b32b64.
> 
> Steven added commit ba911ea7fc1fdd13e3bce1b2001f5b432df8edae which does
> exactly the same thing. Now we end up with a duplicate declaration of
> the function trace_util_ftrace_options(). Reverting the commit gets rid
> of the warning.

Cleaning out my INBOX again, and came across these two patches. I
applied them now.

My INBOX gets blasted sometimes, and I miss patches like this. Don't be
afraid to ping me after a week if I don't apply them.

Or if you don't mind waiting a few months, where I start cleaning out my
INBOX, I'll apply them when I come across them again ;-)

-- Steve

> 
> Signed-off-by: Vaibhav Nagarnaik <vnagarnaik@google.com>
> ---
>  trace-cmd.h |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/trace-cmd.h b/trace-cmd.h
> index 3f522ee..f904dc5 100644
> --- a/trace-cmd.h
> +++ b/trace-cmd.h
> @@ -218,7 +218,6 @@ long tracecmd_flush_recording(struct tracecmd_recorder *recorder);
>  /* --- Plugin handling --- */
>  extern struct plugin_option trace_ftrace_options[];
>  
> -void trace_util_ftrace_options(void);
>  void trace_util_add_option(const char *name, const char *val);
>  void trace_util_load_plugins(struct pevent *pevent, const char *suffix,
>  			     void (*load_plugin)(struct pevent *pevent,



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] Revert "trace-cmd: Add function declaration to fix compile warning"
  2012-05-21 14:14 ` [PATCH 1/2] Revert "trace-cmd: Add function declaration to fix compile warning" Steven Rostedt
@ 2012-05-21 17:33   ` Vaibhav Nagarnaik
  0 siblings, 0 replies; 4+ messages in thread
From: Vaibhav Nagarnaik @ 2012-05-21 17:33 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Justin Teravest, David Sharp, linux-kernel

On Mon, May 21, 2012 at 7:14 AM, Steven Rostedt <rostedt@goodmis.org> wrote:
> Cleaning out my INBOX again, and came across these two patches. I
> applied them now.
>
> My INBOX gets blasted sometimes, and I miss patches like this. Don't be
> afraid to ping me after a week if I don't apply them.
>
> Or if you don't mind waiting a few months, where I start cleaning out my
> INBOX, I'll apply them when I come across them again ;-)
>

Thanks Steve.

Vaibhav Nagarnaik

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-05-21 17:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-19 20:28 [PATCH 1/2] Revert "trace-cmd: Add function declaration to fix compile warning" Vaibhav Nagarnaik
2012-03-19 20:28 ` [PATCH 2/2] trace-cmd: Close the trace file descriptor Vaibhav Nagarnaik
2012-05-21 14:14 ` [PATCH 1/2] Revert "trace-cmd: Add function declaration to fix compile warning" Steven Rostedt
2012-05-21 17:33   ` Vaibhav Nagarnaik

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.