Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp181956yba; Fri, 5 Apr 2019 04:42:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqyqY1xGrtPem2thN04SxLWxYwoJuAlGeCm2SWjLIWCoJpOLoGzYWmL1lhcG+VRt+K4wnmYW X-Received: by 2002:a17:902:b191:: with SMTP id s17mr12044538plr.70.1554464539569; Fri, 05 Apr 2019 04:42:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554464539; cv=none; d=google.com; s=arc-20160816; b=oNSZMBJJNUxbtC6XwAF46U5dF8Ma+FdWmlaHh2nZKBwgovzUHtzfuivs9ck4nHTPPD vE1OxFcIztdw75hKGRQRKHFyCHkg1bfpN+uVRmV9l+ZYZZpBz8bAX129X1SJGlR2DubU yX62i2p8SQlApyztlz/qNnnuWa8RCAjLznWWHmxkTp6AegbOfXYu6Dzure+IuWTXziUG OWqeHpBdIKvW2/pCxKPjKyJDgn+oxKg8TOVg4gRCD8T9WCNRiWy26rmIL/hlNlbKrpkf bDFu/9/VHvqE7awKHDSUvoU4gTtZ+6b/qJxTAoUEYtoQeKs4QkL+mTrsEVCd5AAIfoXP GFrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date; bh=T2DbbMsB2WM6g9Y9WNKxaNiwMSObIhVTSjyMm7vf0G8=; b=Fu2gjPKq0WAleIabhqiE8ts0uL6oeh3ak7CaHqnMyU4Xg/O0wzTpuGf4cIFkpnhBJG Nb02pjZqLHZbZj4e3sKAXkfOyOB0DxXkyxnEf16w87fbA6WPKupwZy+LTDqp90ToWhno kcTw15KoXubolDdK8nTtTrbmClPEd6J4ycehAREpkOWvQ47zYhjIs60SWcZyuvw36jy7 XgPlfh1+WNVFfDZYAWxNpiYEQakok0h4yDYVf0jnrMj6hiHbLccMHeflhBq1qQz0FBfc 2oVYY1cki9vprphkfeenqXYPMY1LD4IYtBGEKqCSJ7b03YgDKxxDdbodqQcn/5T+BLME iZVQ== 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 a12si18180013pls.209.2019.04.05.04.42.04; Fri, 05 Apr 2019 04:42:19 -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 S1731096AbfDELlG (ORCPT + 99 others); Fri, 5 Apr 2019 07:41:06 -0400 Received: from terminus.zytor.com ([198.137.202.136]:59021 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730596AbfDELlG (ORCPT ); Fri, 5 Apr 2019 07:41:06 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x35BdvXG2734759 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 5 Apr 2019 04:39:57 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x35Bdvau2734756; Fri, 5 Apr 2019 04:39:57 -0700 Date: Fri, 5 Apr 2019 04:39:57 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Andi Kleen Message-ID: Cc: mingo@kernel.org, acme@redhat.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, jolsa@kernel.org, ak@linux.intel.com, hpa@zytor.com Reply-To: ak@linux.intel.com, jolsa@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, acme@redhat.com, mingo@kernel.org, tglx@linutronix.de In-Reply-To: <20190326221823.11518-4-andi@firstfloor.org> References: <20190326221823.11518-4-andi@firstfloor.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf evsel: Support printing evsel name for 'duration_time' Git-Commit-ID: 3371f389e4be6efc496ca395b21911a8f2c2d23f X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 3371f389e4be6efc496ca395b21911a8f2c2d23f Gitweb: https://git.kernel.org/tip/3371f389e4be6efc496ca395b21911a8f2c2d23f Author: Andi Kleen AuthorDate: Tue, 26 Mar 2019 15:18:22 -0700 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 1 Apr 2019 14:49:24 -0300 perf evsel: Support printing evsel name for 'duration_time' Implement printing the correct name for duration_time Signed-off-by: Andi Kleen Acked-by: Jiri Olsa Link: http://lkml.kernel.org/r/20190326221823.11518-4-andi@firstfloor.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/evsel.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 66d066f18b5b..84cfb9fe2fc6 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -580,6 +580,12 @@ static int perf_evsel__raw_name(struct perf_evsel *evsel, char *bf, size_t size) return ret + perf_evsel__add_modifiers(evsel, bf + ret, size - ret); } +static int perf_evsel__tool_name(char *bf, size_t size) +{ + int ret = scnprintf(bf, size, "duration_time"); + return ret; +} + const char *perf_evsel__name(struct perf_evsel *evsel) { char bf[128]; @@ -601,7 +607,10 @@ const char *perf_evsel__name(struct perf_evsel *evsel) break; case PERF_TYPE_SOFTWARE: - perf_evsel__sw_name(evsel, bf, sizeof(bf)); + if (evsel->tool_event) + perf_evsel__tool_name(bf, sizeof(bf)); + else + perf_evsel__sw_name(evsel, bf, sizeof(bf)); break; case PERF_TYPE_TRACEPOINT: