Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2731489ybl; Thu, 29 Aug 2019 12:05:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqweh342XuV+DrKHVk4DqtLAFvnLOpnEuqVoKHuAo6i3gF5wj+FS/QgriloYrqW9NxrVCwwO X-Received: by 2002:a17:902:166:: with SMTP id 93mr11721721plb.195.1567105517776; Thu, 29 Aug 2019 12:05:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567105517; cv=none; d=google.com; s=arc-20160816; b=IWqKgKHjPDI5+wXthjOvQ8+3CAOgo29MhTxpBSHxs91o/SXoD/66j/UNj/0b13Pfuf NSPa0uqHAb2PsfhiZeNYOk+UlmnOnxvz005zyde5pnZa+g//u4QsPRFbCl0k2+64Kmpu NlcrFOpp32YJWmqMaLwveLwqBYrmbBNCFwMLAGzCgtL2hC2JLEyu96y6za6gJZni5vdp CPKmjVdG6G02q6UMieA0ZrY0K+/Y22UZxA9JxH9wqV8+5Z2qBGQlkGpYkgWGXfQ+sYJQ bVUd3yuQv24dqPsk8yaFkjRn20W11FwcFvCi8m3UIgc7ii2eiXQKch6BIbXCar/n4eNR ykOQ== 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=Z/dCSDZnWyzZEln4taf9aYexYSWMj28aYYUF36F1Xbw=; b=dh6BBw/QZTOQJw6PnUeBlRre5ehDe9qIu+QG82FKX41+AOlmuZ+KiiFILeCxLUw16S svf4B/l2DzRFci4Iqt7rWaUJbSzRrsVDDVUXCRjd1pSTXvU5lAJpWuJoOtr/VTYgs19w oeBPAZBUHY/KTo1UWbnYkMIWDv9xu3SF8MeReKMXUr6tJmbPqqRzUkT7hEGAu8Rk2MjG nJTn3Kn3VPfnk+7w3mSOcgWuGAw0KV87CGXWnJclqyKxAbPc6F0Fo/5ranvDzjMuQOkT t3zIPpbbMmklDj/PlQbk5DBTgwwTVOzWT5K+1wGgG8XSfAzQHivszf9npEpToUIA3Nlu db5A== 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 n22si2890738pjt.55.2019.08.29.12.05.02; Thu, 29 Aug 2019 12:05:17 -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 S1728843AbfH2TCK (ORCPT + 99 others); Thu, 29 Aug 2019 15:02:10 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:51489 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728782AbfH2TCJ (ORCPT ); Thu, 29 Aug 2019 15:02:09 -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 1i3PgH-0005DN-MA; Thu, 29 Aug 2019 21:02:01 +0200 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id C04DA1C0DED; Thu, 29 Aug 2019 21:01:58 +0200 (CEST) Date: Thu, 29 Aug 2019 19:01:58 -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_STAT 'struct stat_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-17-jolsa@kernel.org> References: <20190828135717.7245-17-jolsa@kernel.org> MIME-Version: 1.0 Message-ID: <156710531865.10589.6576230534513379742.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: 18a13a60f6f50f2fb1f7354f6d0b2ded01995443 Gitweb: https://git.kernel.org/tip/18a13a60f6f50f2fb1f7354f6d0b2ded01995443 Author: Jiri Olsa AuthorDate: Wed, 28 Aug 2019 15:57:10 +02:00 Committer: Arnaldo Carvalho de Melo CommitterDate: Thu, 29 Aug 2019 08:36:12 -03:00 libperf: Add PERF_RECORD_STAT 'struct stat_event' to perf/event.h Move the PERF_RECORD_STAT 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. 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-17-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/lib/include/perf/event.h | 17 +++++++++++++++++ tools/perf/util/event.h | 17 ----------------- tools/perf/util/stat.c | 4 ++-- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/tools/perf/lib/include/perf/event.h b/tools/perf/lib/include/perf/event.h index ba6ed24..7d1834f 100644 --- a/tools/perf/lib/include/perf/event.h +++ b/tools/perf/lib/include/perf/event.h @@ -282,4 +282,21 @@ struct stat_config_event { struct stat_config_event_entry data[]; }; +struct stat_event { + struct perf_event_header header; + + __u64 id; + __u32 cpu; + __u32 thread; + + union { + struct { + __u64 val; + __u64 ena; + __u64 run; + }; + __u64 values[3]; + }; +}; + #endif /* __LIBPERF_EVENT_H */ diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h index 68531d0..f3a02e0 100644 --- a/tools/perf/util/event.h +++ b/tools/perf/util/event.h @@ -332,23 +332,6 @@ struct events_stats { u32 nr_proc_map_timeout; }; -struct stat_event { - struct perf_event_header header; - - u64 id; - u32 cpu; - u32 thread; - - union { - struct { - u64 val; - u64 ena; - u64 run; - }; - u64 values[3]; - }; -}; - enum { PERF_STAT_ROUND_TYPE__INTERVAL = 0, PERF_STAT_ROUND_TYPE__FINAL = 1, diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c index f985336..c0cd9f9 100644 --- a/tools/perf/util/stat.c +++ b/tools/perf/util/stat.c @@ -405,9 +405,9 @@ size_t perf_event__fprintf_stat(union perf_event *event, FILE *fp) struct stat_event *st = (struct stat_event *) event; size_t ret; - ret = fprintf(fp, "\n... id %" PRIu64 ", cpu %d, thread %d\n", + ret = fprintf(fp, "\n... id %" PRI_lu64 ", cpu %d, thread %d\n", st->id, st->cpu, st->thread); - ret += fprintf(fp, "... value %" PRIu64 ", enabled %" PRIu64 ", running %" PRIu64 "\n", + ret += fprintf(fp, "... value %" PRI_lu64 ", enabled %" PRI_lu64 ", running %" PRI_lu64 "\n", st->val, st->ena, st->run); return ret;