mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Josef Bacik <jbacik@fb.com>
To: <linux-kernel@vger.kernel.org>, <kernel-team@fb.com>,
	<rostedt@goodmis.org>
Subject: [PATCH] trace-cmd: fix report not working with instances
Date: Tue, 14 Jul 2015 11:01:04 -0400	[thread overview]
Message-ID: <1436886064-11559-1-git-send-email-jbacik@fb.com> (raw)

We unconditionally call trace_init_profile in read_data_info, even if we don't
have profile set.  This causes trace-cmd report to fail out if you recorded
using instances because the profile stuff doesn't find the handle for the
instance when it does the record.  So do 2 things

1) Only call trace_init_profile if we actually specified --profile.

2) Make sure to call trace_init_profile for all of the instance handles so that
we get all the info we want and don't bail out.

With this patch I can now do trace-cmd report on a trace.dat file that only had
events in instances.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fb.com>
---
 trace-read.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/trace-read.c b/trace-read.c
index 103bc0c..50e7a5d 100644
--- a/trace-read.c
+++ b/trace-read.c
@@ -1066,7 +1066,6 @@ static void read_data_info(struct list_head *handle_list, enum output_type otype
 			last_hook->next = tracecmd_hooks(handles->handle);
 		else
 			hooks = tracecmd_hooks(handles->handle);
-		trace_init_profile(handles->handle, hooks, global);
 
 		process_filters(handles);
 
@@ -1087,7 +1086,11 @@ static void read_data_info(struct list_head *handle_list, enum output_type otype
 					continue;
 				}
 				add_handle(new_handle, name);
+				if (profile)
+					trace_init_profile(new_handle, hooks, global);
 			}
+		} else if (profile) {
+			trace_init_profile(handles->handle, hooks, global);
 		}
 	}
 
-- 
2.1.0


                 reply	other threads:[~2015-07-14 15:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1436886064-11559-1-git-send-email-jbacik@fb.com \
    --to=jbacik@fb.com \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /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

all inboxes | Powered by JetHome®