From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933375AbeAIPlT (ORCPT + 1 other); Tue, 9 Jan 2018 10:41:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60094 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933135AbeAIPhc (ORCPT ); Tue, 9 Jan 2018 10:37:32 -0500 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Namhyung Kim , David Ahern , Andi Kleen , Alexander Shishkin , Peter Zijlstra Subject: [PATCH 40/49] perf record: Move waking into struct record Date: Tue, 9 Jan 2018 16:35:13 +0100 Message-Id: <20180109153522.14116-41-jolsa@kernel.org> In-Reply-To: <20180109153522.14116-1-jolsa@kernel.org> References: <20180109153522.14116-1-jolsa@kernel.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 09 Jan 2018 15:37:32 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: We need to keep global number of 'waking' now. TODO: make this multiple threads safe. Link: http://lkml.kernel.org/n/tip-veetgk62aisdt1cxaa6fbgox@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/builtin-record.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 4d08f81a3bfe..5fd0a955a52d 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -94,6 +94,7 @@ struct record { unsigned long long samples; struct record_thread *threads; int threads_cnt; + unsigned long waking; }; static __thread struct record_thread *thread; @@ -1116,7 +1117,6 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) { int err; int status = 0; - unsigned long waking = 0; const bool forks = argc > 0; struct machine *machine; struct perf_tool *tool = &rec->tool; @@ -1368,8 +1368,8 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) if (!quiet) fprintf(stderr, "[ perf record: dump data: Woken up %ld times ]\n", - waking); - waking = 0; + rec->waking); + rec->waking = 0; fd = record__switch_output(rec, false); if (fd < 0) { pr_err("Failed to switch to new file\n"); @@ -1393,7 +1393,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) */ if (err > 0 || (err < 0 && errno == EINTR)) err = 0; - waking++; + rec->waking++; if (perf_evlist__filter_pollfd(rec->evlist, POLLERR | POLLHUP) == 0) draining = true; @@ -1422,7 +1422,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) } if (!quiet) - fprintf(stderr, "[ perf record: Woken up %ld times to write data ]\n", waking); + fprintf(stderr, "[ perf record: Woken up %ld times to write data ]\n", rec->waking); if (target__none(&rec->opts.target)) record__synthesize_workload(rec, true); -- 2.13.6