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 D39F2C433DF for ; Tue, 13 Oct 2020 14:18:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7F33724808 for ; Tue, 13 Oct 2020 14:18:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602598691; bh=20EOdtXnWxOJ876IXC/aCEshOJ/JHm8zvad+Y0ixElM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:List-ID:From; b=W2iz44zNB87Trs9TFiseYmWB7JRS7Ls5dk6IWkcJCdIWICL8wQHGBIQSEBTkHxyzK 9Rj3jKf3wDxaLD/orL21lIFNGxff3NQEx8vviofBzojpEeoNWiIninkNdoUCzfuX2J HOrCvIEuaVx/muEojSThCucShjHbIbmN9DGGfz90= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729296AbgJMOSK (ORCPT ); Tue, 13 Oct 2020 10:18:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:33300 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726897AbgJMOSD (ORCPT ); Tue, 13 Oct 2020 10:18:03 -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 A00B3247FE; Tue, 13 Oct 2020 14:18:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602598683; bh=20EOdtXnWxOJ876IXC/aCEshOJ/JHm8zvad+Y0ixElM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=SB+TvbwoJQsweMOSZ80Ius85BTUjkDeTIKH/opQys90o86RvGUhbR/ckDKZAdWqDq 4vIaMlrqfw7y8yuxi3qx3r3XukPOH7eYd0fa9onqFkdEYSuAn6i6Xr+FmFGvAE13CD kTLe94Mmw+T07afXYd2M5kM4WA/b8AfsDmSKlGvA= From: Tom Zanussi To: rostedt@goodmis.org, axelrasmussen@google.com Cc: mhiramat@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/7] tracing: Don't show dynamic string internals in synthetic event description Date: Tue, 13 Oct 2020 09:17:52 -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