From patchwork Fri Jun 8 12:23:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Antipov X-Patchwork-Id: 9176 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 309BE23E5A for ; Fri, 8 Jun 2012 12:21:21 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id E7E27A1849E for ; Fri, 8 Jun 2012 12:21:20 +0000 (UTC) Received: by yhpp61 with SMTP id p61so1288370yhp.11 for ; Fri, 08 Jun 2012 05:21:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=AQjUkAhaKbEr4FnIg+XqNiOiZug8DcJrMYtE5AFdfzk=; b=DGdB5BqaPRQkfgL9oOaRWlhKUv6DSEykGMhuV+PHJU4/3/jMl1ErePX8B/YTj9pbd1 gZgK3dmWmuSvInGz2GHakCsoKcB8xCfA1oX8kIKqM1okwNU6+N7/PveALgnsW0BDdG/B XAP08CbL/5TOFnQ3QCA8UEGkCosaH2ZBkeTYn211nGXZGQd0Enr6vlwBFagnRZgXFaEI vEfSkK9RIGNt37jEJfBB4ryDmLM7YJj9yiWJBtmH4JB/ccNGtz8sN5AnRBTxaWpamUxG sOa7XCV4wAW/kuXP1RQpTBaOqsQTIUgjTDJpyLD2r9ZQK4BzwJfAAmLmH4vjPmwY4im5 Uh9g== Received: by 10.50.203.39 with SMTP id kn7mr2671952igc.53.1339158080282; Fri, 08 Jun 2012 05:21:20 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.24.148 with SMTP id v20csp33954ibb; Fri, 8 Jun 2012 05:21:19 -0700 (PDT) Received: by 10.152.111.200 with SMTP id ik8mr8056119lab.15.1339158079027; Fri, 08 Jun 2012 05:21:19 -0700 (PDT) Received: from mail-lpp01m010-f50.google.com (mail-lpp01m010-f50.google.com [209.85.215.50]) by mx.google.com with ESMTPS id r10si5801360lbd.65.2012.06.08.05.21.18 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 08 Jun 2012 05:21:18 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.50 is neither permitted nor denied by best guess record for domain of dmitry.antipov@linaro.org) client-ip=209.85.215.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.215.50 is neither permitted nor denied by best guess record for domain of dmitry.antipov@linaro.org) smtp.mail=dmitry.antipov@linaro.org Received: by lahm15 with SMTP id m15so1584737lah.37 for ; Fri, 08 Jun 2012 05:21:18 -0700 (PDT) Received: by 10.112.41.2 with SMTP id b2mr3867413lbl.58.1339158078169; Fri, 08 Jun 2012 05:21:18 -0700 (PDT) Received: from localhost.localdomain ([78.153.153.8]) by mx.google.com with ESMTPS id fy10sm9494208lab.0.2012.06.08.05.21.15 (version=SSLv3 cipher=OTHER); Fri, 08 Jun 2012 05:21:17 -0700 (PDT) From: Dmitry Antipov To: Arnaldo Carvalho de Melo , Ingo Molnar , Paul Mackerras , Peter Zijlstra Cc: linux-kernel@vger.kernel.org, linaro-dev@lists.linaro.org, patches@linaro.org, Dmitry Antipov Subject: [PATCH] perf report: fix event name reporting Date: Fri, 8 Jun 2012 16:23:27 +0400 Message-Id: <1339158207-20575-1-git-send-email-dmitry.antipov@linaro.org> X-Mailer: git-send-email 1.7.7.6 X-Gm-Message-State: ALoCoQniQ4Dhef7M1StSHAPy3MBayOms9RWYzhVwB+7gyK83eBCk8VHUy6dVScCQqzgBwxqfYXak Use trace_find_event to find event name before looking through /sys files. This helps 'perf report' to show real event names instead of 'unknown:unknown' when processing perf.data recorded on another machine. Signed-off-by: Dmitry Antipov --- tools/perf/builtin-report.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 8c767c6..a6fd309 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -24,6 +24,7 @@ #include "util/evlist.h" #include "util/evsel.h" #include "util/header.h" +#include "util/trace-event.h" #include "util/session.h" #include "util/tool.h" @@ -314,7 +315,8 @@ static int perf_evlist__tty_browse_hists(struct perf_evlist *evlist, list_for_each_entry(pos, &evlist->entries, node) { struct hists *hists = &pos->hists; - const char *evname = event_name(pos); + struct event_format *event = trace_find_event(pos->attr.config); + const char *evname = event ? event->name : event_name(pos); hists__fprintf_nr_sample_events(hists, evname, stdout); hists__fprintf(hists, NULL, false, true, 0, 0, stdout);