Received: by 10.192.165.156 with SMTP id m28csp2084200imm; Thu, 12 Apr 2018 08:21:02 -0700 (PDT) X-Google-Smtp-Source: AIpwx48z7SUuR3OUZ4XK9pLtKrHQWmuzs7APLz1TjgC7zc7w0nGXWMjST3nf8paLAc4jzx8ovlwu X-Received: by 2002:a17:902:102:: with SMTP id 2-v6mr1528989plb.48.1523546462226; Thu, 12 Apr 2018 08:21:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523546462; cv=none; d=google.com; s=arc-20160816; b=S87GP0F8Czb1bVvQwqaLFPFL4Tij219gDGM1+SAjUIQJAmHxLsuc546jTPLIL56ag7 Vjals1amh7py5tGdtYThcDCMFxj9vacSCRVBgUMxXWu45B1zVCDvT8FNyvsPPY4R/UQv gM2KBnVfOMr+GVS3LJV9PcvZymMpCZwVEde+Fsc62zY+gPH2TWV//sunimEwGyTKrXjS ih14AL15B8iH1PCm2CHfJqF8uRexW4+G9Czf/TNEgKS9y7taX2HH1pwcbMSbnYewRid8 Y1Txff1cm7XGptSUIUuujKBQgIoOK1Tsdar/TnePz/XUJNBzBzhZpk8XpX3v6s+t5D+n 6EKA== 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=nBLv4bjfz8dLgs0OTTI6PoQD4I4cWNGyaDE+fekzhco=; b=AJWOg4fCe7URhHYCxASbFJ4agxKXofbq3ihm8jecoksIftipC9Au4uJxgzVOexYn0B HxS5INfNAWWVEDxwbEkFBl2FhkG8psszkLUVftkzIdwGAtbBbBbEiWtOdmpMQYDaF90o edypGqlu0vTYD8LkKJN3LF2ABA2btZ2nEN9BgB6n6Ug74D70C97RFeLnT/t46byw+gHU hY/s7qo4DnrzSPmN46MkJuIljUNkUtgCj1495P6wEwwqP+uNTvau93kdhyF/JPG8rfVi g8HIX3G8IGcGXrYjXRiCnZ09hQ807fxDZTVySCqGMTX4ZiMnpHcv1pMBJuE/qEDlUKsd Ob3w== 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 p6si2438086pgv.11.2018.04.12.08.20.25; Thu, 12 Apr 2018 08:21:02 -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 S1754230AbeDLPPk (ORCPT + 99 others); Thu, 12 Apr 2018 11:15:40 -0400 Received: from mga03.intel.com ([134.134.136.65]:19745 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754133AbeDLPNj (ORCPT ); Thu, 12 Apr 2018 11:13:39 -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 orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Apr 2018 08:13:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,442,1517904000"; d="scan'208";a="36745796" Received: from cbeckton-mobl.amr.corp.intel.com (HELO localhost) ([10.255.230.227]) by fmsmga002.fm.intel.com with ESMTP; 12 Apr 2018 08:13:36 -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 3/6] tracing: Save the last hist command's associated event name Date: Thu, 12 Apr 2018 10:13:18 -0500 Message-Id: <1b0ae2e2fb4275fa2ea47df816888c573a87526c.1523545519.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 In preparation for making use of the new trace event error log, save the subsystem and event name associated with the last hist command - it will be passed as the location param in the event_log_err() calls. Signed-off-by: Tom Zanussi --- kernel/trace/trace_events_hist.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index 66c87be..4a42df4 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -354,14 +354,32 @@ struct action_data { static char last_hist_cmd[MAX_FILTER_STR_VAL]; +static char last_hist_cmd_event[MAX_FILTER_STR_VAL]; static char hist_err_str[MAX_FILTER_STR_VAL]; -static void last_cmd_set(char *str) +static void last_cmd_set(struct trace_event_file *file, char *str) { + const char *system = NULL, *name = NULL; + struct trace_event_call *call; + if (!str) return; strncpy(last_hist_cmd, str, MAX_FILTER_STR_VAL - 1); + + if (file) { + call = file->event_call; + + system = call->class->system; + if (system) { + name = trace_event_name(call); + if (!name) + system = NULL; + } + } + + if (system) + snprintf(last_hist_cmd_event, MAX_FILTER_STR_VAL, "%s:%s", system, name); } static void hist_err(char *str, char *var) @@ -401,6 +419,8 @@ static void hist_err_event(char *str, char *system, char *event, char *var) static void hist_err_clear(void) { hist_err_str[0] = '\0'; + last_hist_cmd[0] = '\0'; + last_hist_cmd_event[0] = '\0'; } static bool have_hist_err(void) @@ -5478,8 +5498,8 @@ static int event_hist_trigger_func(struct event_command *cmd_ops, int ret = 0; if (glob && strlen(glob)) { - last_cmd_set(param); hist_err_clear(); + last_cmd_set(file, param); } if (!param) -- 1.9.3