Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2733535ybl; Thu, 29 Aug 2019 12:06:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqyU9nJbyZHA6FA6m5rRCj7jhsudS4C3pjOeRFuCJ5NEH7xb/Abmx3zM/VNK8pIKAgUlDFet X-Received: by 2002:a17:90a:30ad:: with SMTP id h42mr11369815pjb.31.1567105595964; Thu, 29 Aug 2019 12:06:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567105595; cv=none; d=google.com; s=arc-20160816; b=0LfLWlMjIB/nLLT5W/SOwY12xcNp9tK21yLFlWbPoMR6rzNuipNzSe/7HTrgWFQcWG 9LuFnKzDBE8UlEDnlroYY1+kC96E5R7VUIIkadfB49g3pf1ZOEJkRbHjxjOJEFdlFqo9 zQ6lFrZ71O7Doi599U/heNnDhtWk+iCsBSDmQq71ULbRspTzs37VgsZzK2bWX1F0XvCP VK2dqqhG/mUtlFoe4DlUDJDalXLqhJHG7BJ5YukcEAv52btrpt/rDG557ijZfYXLNy08 uIza5DsP1TTn3sAvKfIdgPxVReK11Vfhr7BeuVUc6B5/aUBWbI7hLrYpFv/LsvQgRW9p xrDA== 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 :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=KaJwOHnafjxo+nyUHrN6fJI/2DvIYd2+v5ZUnK0cylU=; b=T639eOYxfYuJtylKbVjFx2x1ytUnF/6ePW3/pK7In4V25PqWY6ip54xoIxGVpbOcpG kO3IPe/DUlyYroOnp/rueIyCqdyK+swhLbjqJ6QJ84Feoc8DOT9AvAkKa9ejVKSgmWr+ 6meYEdxo+DvuU2c5PFRxnEik8iAwIoAl35dZYrpgWmt0VgXgdspzxQd4pmwiib3NOXai pEuFBhlc9k71kNkcpM5uuBk6uZ+Hlw86OCR9MnUlED/3ECnKsL7DhZCOcM0kXvb7OhqR 0pWzJy+TB8ZeqFK+pBHXSnWfDecqFgnqBDci0FhbTXAJ8QTsWsVV0ldZ1DMDcHOqUvLb 7xlQ== 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 n2si2675407pga.426.2019.08.29.12.06.20; Thu, 29 Aug 2019 12:06: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 S1729440AbfH2TDf (ORCPT + 99 others); Thu, 29 Aug 2019 15:03:35 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:51465 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728640AbfH2TCG (ORCPT ); Thu, 29 Aug 2019 15:02:06 -0400 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1i3PgF-00058D-V4; Thu, 29 Aug 2019 21:02:00 +0200 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 5C5F91C0DE9; Thu, 29 Aug 2019 21:01:54 +0200 (CEST) Date: Thu, 29 Aug 2019 19:01:54 -0000 From: "tip-bot2 for Jiri Olsa" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] libperf: Add PERF_RECORD_ID_INDEX 'struct id_index_event' to perf/event.h Cc: Jiri Olsa , Alexander Shishkin , Michael Petlan , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo , Ingo Molnar , Borislav Petkov , linux-kernel@vger.kernel.org In-Reply-To: <20190828135717.7245-8-jolsa@kernel.org> References: <20190828135717.7245-8-jolsa@kernel.org> MIME-Version: 1.0 Message-ID: <156710531425.10561.3393738240075496572.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the perf/core branch of tip: Commit-ID: fecb410030628d70401e06a98a585d735f61d7e2 Gitweb: https://git.kernel.org/tip/fecb410030628d70401e06a98a585d735f61d7e2 Author: Jiri Olsa AuthorDate: Wed, 28 Aug 2019 15:57:01 +02:00 Committer: Arnaldo Carvalho de Melo CommitterDate: Wed, 28 Aug 2019 18:15:05 -03:00 libperf: Add PERF_RECORD_ID_INDEX 'struct id_index_event' to perf/event.h Move the PERF_RECORD_ID_INDEX event definition to libperf's event.h. In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions. Add the PRI_ld64 define, so we can use it in printf output. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20190828135717.7245-8-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/lib/include/perf/event.h | 13 +++++++++++++ tools/perf/util/event.h | 15 ++------------- tools/perf/util/session.c | 8 ++++---- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/tools/perf/lib/include/perf/event.h b/tools/perf/lib/include/perf/event.h index 5e6b6d1..c68523c 100644 --- a/tools/perf/lib/include/perf/event.h +++ b/tools/perf/lib/include/perf/event.h @@ -188,4 +188,17 @@ struct build_id_event { char filename[]; }; +struct id_index_entry { + __u64 id; + __u64 idx; + __u64 cpu; + __u64 tid; +}; + +struct id_index_event { + struct perf_event_header header; + __u64 nr; + struct id_index_entry entries[0]; +}; + #endif /* __LIBPERF_EVENT_H */ diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h index 4b6cf89..82315d2 100644 --- a/tools/perf/util/event.h +++ b/tools/perf/util/event.h @@ -22,9 +22,11 @@ */ #define PRI_lu64 "l" PRIu64 #define PRI_lx64 "l" PRIx64 +#define PRI_ld64 "l" PRId64 #else #define PRI_lu64 PRIu64 #define PRI_lx64 PRIx64 +#define PRI_ld64 PRId64 #endif #define PERF_SAMPLE_MASK \ @@ -330,19 +332,6 @@ struct events_stats { u32 nr_proc_map_timeout; }; -struct id_index_entry { - u64 id; - u64 idx; - u64 cpu; - u64 tid; -}; - -struct id_index_event { - struct perf_event_header header; - u64 nr; - struct id_index_entry entries[0]; -}; - struct auxtrace_info_event { struct perf_event_header header; u32 type; diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index a275f2e..aa96674 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -2393,10 +2393,10 @@ int perf_event__process_id_index(struct perf_session *session, struct perf_sample_id *sid; if (dump_trace) { - fprintf(stdout, " ... id: %"PRIu64, e->id); - fprintf(stdout, " idx: %"PRIu64, e->idx); - fprintf(stdout, " cpu: %"PRId64, e->cpu); - fprintf(stdout, " tid: %"PRId64"\n", e->tid); + fprintf(stdout, " ... id: %"PRI_lu64, e->id); + fprintf(stdout, " idx: %"PRI_lu64, e->idx); + fprintf(stdout, " cpu: %"PRI_ld64, e->cpu); + fprintf(stdout, " tid: %"PRI_ld64"\n", e->tid); } sid = perf_evlist__id2sid(evlist, e->id);