From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33746C433DF for ; Fri, 9 Oct 2020 15:17:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D455B222E8 for ; Fri, 9 Oct 2020 15:17:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602256640; bh=20EOdtXnWxOJ876IXC/aCEshOJ/JHm8zvad+Y0ixElM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:List-ID:From; b=emtf2Zg3ngRE1UNi6ygB2PBOj0pHvkDBINSp/UrHiLpzGoc8N+l+c/2W/acYBD74u TWue6MeIw+c/aJ0tq8avcHX4ek6NHNVUWjXFFBn+ACvzMjpuIM+r6RvD/ypxju147C SZ0DigK0aePqdvsi3LxZ9yrQF/3FYNkec53e1aYk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389232AbgJIPRT (ORCPT ); Fri, 9 Oct 2020 11:17:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:40740 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387978AbgJIPRQ (ORCPT ); Fri, 9 Oct 2020 11:17:16 -0400 Received: from localhost.localdomain (c-73-209-127-30.hsd1.il.comcast.net [73.209.127.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C53FF222C3; Fri, 9 Oct 2020 15:17:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602256636; bh=20EOdtXnWxOJ876IXC/aCEshOJ/JHm8zvad+Y0ixElM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=eWShpu4ucZTDc2T8SCVWasr9UxCOvXYPhz/JyCbl7Ih1azpEKGjmF2pl+o4yA2Rgz hPEfqm8KThgLrDRMkl1O4vUpKoj/XabJMyR7W38M20rzNU2VB3YgNRG7IT92yhucds QiXqWvny7YYPz6OyevP7T/pV4YguyxjibPEPu2ec= From: Tom Zanussi To: rostedt@goodmis.org, axelrasmussen@google.com Cc: mhiramat@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/5] tracing: Don't show dynamic string internals in synthetic event description Date: Fri, 9 Oct 2020 10:17:07 -0500 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For synthetic event dynamic fields, the type contains "__data_loc", which is basically an internal part of the type which is only meant to be displayed in the format, not in the event description itself, which is confusing to users since they can't use __data_loc on the command-line to define an event field, which printing it would lead them to believe. So filter it out from the description, while leaving it in the type. Reported-by: Masami Hiramatsu Signed-off-by: Tom Zanussi --- kernel/trace/trace_events_synth.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/kernel/trace/trace_events_synth.c b/kernel/trace/trace_events_synth.c index 3b2dcc42b8ee..b19e2f4159ab 100644 --- a/kernel/trace/trace_events_synth.c +++ b/kernel/trace/trace_events_synth.c @@ -1867,14 +1867,22 @@ static int __synth_event_show(struct seq_file *m, struct synth_event *event) { struct synth_field *field; unsigned int i; + char *type, *t; seq_printf(m, "%s\t", event->name); for (i = 0; i < event->n_fields; i++) { field = event->fields[i]; + type = field->type; + t = strstr(type, "__data_loc"); + if (t) { /* __data_loc belongs in format but not event desc */ + t += sizeof("__data_loc"); + type = t; + } + /* parameter values */ - seq_printf(m, "%s %s%s", field->type, field->name, + seq_printf(m, "%s %s%s", type, field->name, i == event->n_fields - 1 ? "" : "; "); } -- 2.17.1