Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752733AbbGNPDH (ORCPT ); Tue, 14 Jul 2015 11:03:07 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:52105 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752304AbbGNPDF (ORCPT ); Tue, 14 Jul 2015 11:03:05 -0400 From: Josef Bacik To: , , Subject: [PATCH] trace-cmd: fix report not working with instances Date: Tue, 14 Jul 2015 11:01:04 -0400 Message-ID: <1436886064-11559-1-git-send-email-jbacik@fb.com> X-Mailer: git-send-email 2.1.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.168.52.123] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.14.151,1.0.33,0.0.0000 definitions=2015-07-14_07:2015-07-14,2015-07-14,1970-01-01 signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1704 Lines: 50 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 --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/