lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 24 Jan 2018 12:51:42 +0100
From:   Jiri Olsa <jolsa@...nel.org>
To:     Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        Ingo Molnar <mingo@...nel.org>
Cc:     lkml <linux-kernel@...r.kernel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        David Ahern <dsahern@...il.com>,
        Andi Kleen <ak@...ux.intel.com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Andy Lutomirski <luto@...capital.net>,
        Arnaldo Carvalho de Melo <acme@...nel.org>
Subject: [PATCH 20/21] perf report: Add user data processing stats

Adding user data processing stats for to review the
processing. Adding following per-thread counters:

  user_data_sample - nb of samples with with
		     PERF_RECORD_MISC_USER_DATA set
  user_data_event  - nb of user data events
  user_data_match  - nb of samples that matched user
                     data event
  user_data_drop   - nb of samples that did not match
                     any user data event and were drop

Link: http://lkml.kernel.org/n/tip-j4zh9fpntjbtjo993cjdn92b@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@...nel.org>
---
 tools/perf/builtin-report.c | 6 ++++++
 tools/perf/util/thread.h    | 8 ++++++++
 2 files changed, 14 insertions(+)

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index a1cd5fd793fc..82b2368d208a 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -314,6 +314,7 @@ perf_thread__add_user_data(struct thread *thread,
 		return -ENOMEM;
 	}
 
+	thread->stats.user_data_sample++;
 	list_add_tail(&entry->list, &thread->user_data_list);
 	return 0;
 }
@@ -425,6 +426,8 @@ thread__flush_user_data(struct thread *thread,
 	struct user_data *entry, *p;
 	int ret = 0;
 
+	thread->stats.user_data_event++;
+
 	list_for_each_entry_safe(entry, p, &thread->user_data_list, list) {
 		/* different event, skip it */
 		if (entry->sample.id != sample->id)
@@ -439,6 +442,9 @@ thread__flush_user_data(struct thread *thread,
 			ret = user_data__process(entry, sample, event, rep);
 			if (ret)
 				pr_debug("problem adding hist entry, skipping event\n");
+			thread->stats.user_data_match++;
+		} else {
+			thread->stats.user_data_drop++;
 		}
 
 		list_del(&entry->list);
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h
index e78b295bbcdb..742bbf8cb285 100644
--- a/tools/perf/util/thread.h
+++ b/tools/perf/util/thread.h
@@ -22,6 +22,13 @@ struct user_data {
 	struct perf_evsel	*evsel;
 };
 
+struct thread_stats {
+	u64	user_data_sample;
+	u64	user_data_event;
+	u64	user_data_match;
+	u64	user_data_drop;
+};
+
 struct thread {
 	union {
 		struct rb_node	 rb_node;
@@ -51,6 +58,7 @@ struct thread {
 	void				*addr_space;
 	struct unwind_libunwind_ops	*unwind_libunwind_ops;
 #endif
+	struct thread_stats	stats;
 };
 
 struct machine;
-- 
2.13.6

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ