Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4710891img; Tue, 26 Mar 2019 15:19:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqz6sJAhbOh16mLEby30vG6kur9lhNTuKCLfu579dmEOLtLkIjTv0qMDrTeqlrA36Lsmo6nN X-Received: by 2002:a63:4241:: with SMTP id p62mr13941629pga.379.1553638775052; Tue, 26 Mar 2019 15:19:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553638775; cv=none; d=google.com; s=arc-20160816; b=ifVyZkUkVrIz4/81mqLd27WLoTdEMnhI1CgZEmaPGnh/Kn48wqmShwcaIAfYiwXeHb KgwowVVDs/wdpmfB4k2pLgQHJeU2b5MmzQ7F9pjaeTsCsz9ScbNhVcVkrACeOTYQtyy5 +O0c/uODe03X7PeDQfhYUm40XURdl6D1HXk8KEbuHWQlCdnZE0f9VXjvL08kDmGwUElM Zo6F0lH8yqKMFGRmTqj/+WfHtHu3IADJPrzB4pIZGWMsY2rFWk5OAlsnYJxbMSkb+pSc /IOLvrgt9FnRMTxlyZP6+bGOpeKBKL08Jed3ZG8jE+7Iuc8wUeX+mvOgR7QnqxRJ+fB6 ORgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=pofrVRopp9qKBBBS534cfOKj8eWf70gxOE941cT5rXo=; b=dLeCNJVL5zpaSRZWhKLDQAaW6mfvRkyVvU13tcph0dVa+bMDau49PXnOkU76dnHCtZ l03K0me0uEV37f3H1w3UC9Us2LYPxZwkUwF98N0c9AwrKWyn3IztkU7zTWbW/hHIM7Rw 9jAMyovFVhjsNPMbcpQvCqsLeOc0vC5Q7wXfIUGkSYRnHiFnicfgSJciu3wiMfO70/4Z VK0mXLIC9Ay93NweAY4hI0UiyV5jeMHmHgVbALOdOubIHQujtDu69WTfWWMCRLKysxZ9 Erd4fGXr17VrkEICr408uZ4OLn9mrywWrnzcOlpQpD6/gsU8bfZMUMF2kZC+knA9LPKp K/mA== 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 p7si17120170pgk.411.2019.03.26.15.19.20; Tue, 26 Mar 2019 15:19:35 -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 S1732270AbfCZWSk (ORCPT + 99 others); Tue, 26 Mar 2019 18:18:40 -0400 Received: from mga01.intel.com ([192.55.52.88]:55268 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731707AbfCZWS3 (ORCPT ); Tue, 26 Mar 2019 18:18:29 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Mar 2019 15:18:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,274,1549958400"; d="scan'208";a="145482960" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.137]) by orsmga002.jf.intel.com with ESMTP; 26 Mar 2019 15:18:28 -0700 Received: by tassilo.localdomain (Postfix, from userid 1000) id BAB2E301C15; Tue, 26 Mar 2019 15:18:28 -0700 (PDT) From: Andi Kleen To: acme@kernel.org Cc: jolsa@kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Andi Kleen Subject: [PATCH 3/4] perf, tools: Support name for duration_time Date: Tue, 26 Mar 2019 15:18:22 -0700 Message-Id: <20190326221823.11518-4-andi@firstfloor.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190326221823.11518-1-andi@firstfloor.org> References: <20190326221823.11518-1-andi@firstfloor.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andi Kleen Implement printing the correct name for duration_time Signed-off-by: Andi Kleen --- 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 7835e05f0c0a..6872394b6f55 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -579,6 +579,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]; @@ -600,7 +606,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: -- 2.20.1