Received: by 10.213.65.68 with SMTP id h4csp809964imn; Wed, 28 Mar 2018 13:13:20 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/KZ9Yy+eoOQBnNz/HaBR2aiGFUeg2I8z+ZCBirDZj/RThG/VXXCzV3FkNK2t7tBZWMNmdr X-Received: by 2002:a17:902:8349:: with SMTP id z9-v6mr5189639pln.163.1522268000469; Wed, 28 Mar 2018 13:13:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522268000; cv=none; d=google.com; s=arc-20160816; b=l28BehrTxtdcYBMu78P6TfoUMSBD2CBDMyq7O7tViCB0SL/vudq/h+FVkzUlMai4j4 gFJDI4fj7YyWTnUnPIXopKOc7yJhrseeCkAGNWox9wB3YYoEvnaCfOi7HZyaXCRksOJ+ FVWg7aw2w3HLARmxhcvVn+UJGiJ8KYmBYYg6Af23uTob59Sw2wBT5V3uE4Zk5L8y99dS A1PYMzZdFGfjwXdc+WCR3Wxq+rUAU2/R33bXwnFLLnuSvq3voOOABOSwPURdBzEQFav5 U37YjmPowe5okn7AItWV643ggS29eodmm0dF4+ydHribOFhRzMjsJwOWIzRfHme9Gt3b AMCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=jES1JNoiedl2XVMmcZv+C2jYstMFwk4Qp/i7Js3EZHg=; b=1IZlTpmy0IVYdnh/R9yFp9UkSLcoM71jsuKrLUBHPuhvsHZiA3E2Z3Kidy/jQMxNDQ ixc9Z+Yc/erxbdgDHh+1b4S0LmiFkBC7AxYn+TAKhvW2OgMFrSU2PeOPxpz5O27+8Lcq cdyM+xnAWbdq3CMyzvQsnv1oQXCXyN47bSvPtsV5VWFq1iHfsWeMnEmuTlEH/27Yxq6s yCaJnoCDMNrncGkAEGuIVa92ev7X6cwuUq4Jrk42EPaMBwJL/5nBVfTaZ65tG3C4ivDb vwPy8PAncRdM1A0IwBwCcqRBCEHkLl0lIFpPBsTFkMcmD0oPtNW3T8VFcYHgUNJFzHkN WajQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g28-v6si4721885plj.10.2018.03.28.13.13.06; Wed, 28 Mar 2018 13:13:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753513AbeC1ULJ (ORCPT + 99 others); Wed, 28 Mar 2018 16:11:09 -0400 Received: from mga11.intel.com ([192.55.52.93]:61115 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753249AbeC1ULG (ORCPT ); Wed, 28 Mar 2018 16:11:06 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Mar 2018 13:11:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,373,1517904000"; d="scan'208";a="32220615" Received: from tzanussi-mobl.amr.corp.intel.com (HELO localhost) ([10.252.193.206]) by fmsmga002.fm.intel.com with ESMTP; 28 Mar 2018 13:11:02 -0700 From: Tom Zanussi To: rostedt@goodmis.org Cc: tglx@linutronix.de, mhiramat@kernel.org, namhyung@kernel.org, vedang.patel@intel.com, bigeasy@linutronix.de, joel.opensrc@gmail.com, joelaf@google.com, mathieu.desnoyers@efficios.com, baohong.liu@intel.com, rajvi.jingar@intel.com, julia@ni.com, fengguang.wu@intel.com, linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org, Tom Zanussi Subject: [PATCH 1/4] tracing: Fix display of hist trigger expressions containing timestamps Date: Wed, 28 Mar 2018 15:10:53 -0500 Message-Id: <92746b06be67499c2a6217bd55395b350ad18fad.1522256721.git.tom.zanussi@linux.intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When displaying hist triggers, variable references that have the timestamp field flag set are erroneously displayed as common_timestamp rather than the variable reference. Additionally, timestamp expressions are displayed in the same way. Fix this by forcing the timestamp flag handling to follow variable reference and expression handling. Before: # cat /sys/kernel/debug/tracing/events/sched/sched_switch/trigger hist:keys=next_pid:vals=hitcount:wakeup_lat=common_timestamp.usecs:... After: # cat /sys/kernel/debug/tracing/events/sched/sched_switch/trigger hist:keys=next_pid:vals=hitcount:wakeup_lat=common_timestamp.usecs-$ts0.usecs:... Signed-off-by: Tom Zanussi --- kernel/trace/trace_events_hist.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index 4f02764..fb81447 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -1686,8 +1686,6 @@ static const char *hist_field_name(struct hist_field *field, else if (field->flags & HIST_FIELD_FL_LOG2 || field->flags & HIST_FIELD_FL_ALIAS) field_name = hist_field_name(field->operands[0], ++level); - else if (field->flags & HIST_FIELD_FL_TIMESTAMP) - field_name = "common_timestamp"; else if (field->flags & HIST_FIELD_FL_CPU) field_name = "cpu"; else if (field->flags & HIST_FIELD_FL_EXPR || @@ -1703,7 +1701,8 @@ static const char *hist_field_name(struct hist_field *field, field_name = full_name; } else field_name = field->name; - } + } else if (field->flags & HIST_FIELD_FL_TIMESTAMP) + field_name = "common_timestamp"; if (field_name == NULL) field_name = ""; @@ -4857,23 +4856,15 @@ static void hist_field_print(struct seq_file *m, struct hist_field *hist_field) if (hist_field->var.name) seq_printf(m, "%s=", hist_field->var.name); - if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP) - seq_puts(m, "common_timestamp"); - else if (hist_field->flags & HIST_FIELD_FL_CPU) + if (hist_field->flags & HIST_FIELD_FL_CPU) seq_puts(m, "cpu"); else if (field_name) { if (hist_field->flags & HIST_FIELD_FL_VAR_REF || hist_field->flags & HIST_FIELD_FL_ALIAS) seq_putc(m, '$'); seq_printf(m, "%s", field_name); - } - - if (hist_field->flags) { - const char *flags_str = get_hist_field_flags(hist_field); - - if (flags_str) - seq_printf(m, ".%s", flags_str); - } + } else if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP) + seq_puts(m, "common_timestamp"); } static int event_hist_trigger_print(struct seq_file *m, -- 1.9.3