From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933488AbeAIPkm (ORCPT + 1 other); Tue, 9 Jan 2018 10:40:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46384 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759144AbeAIPhf (ORCPT ); Tue, 9 Jan 2018 10:37:35 -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 41/49] perf record: Move samples into struct record_thread Date: Tue, 9 Jan 2018 16:35:14 +0100 Message-Id: <20180109153522.14116-42-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.31]); Tue, 09 Jan 2018 15:37:35 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Moving samples value into struct record_thread, because we need to have this value per thread for checking if there have been new data. Link: http://lkml.kernel.org/n/tip-yhah10r7jikirxhbprxs3wlm@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/builtin-record.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 5fd0a955a52d..96f43fb5ba6f 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -71,6 +71,7 @@ struct record_thread { int ovw_mmap_nr; struct fdarray pollfd; struct record *rec; + unsigned long long samples; }; struct record { @@ -159,7 +160,7 @@ static int record__pushfn(struct perf_mmap *map, void *to, void *bf, size_t size { struct record *rec = to; - rec->samples++; + thread->samples++; return record__write(rec, map, bf, size); } @@ -243,7 +244,7 @@ static int record__auxtrace_mmap_read(struct record *rec, return ret; if (ret) - rec->samples++; + thread->samples++; return 0; } @@ -260,7 +261,7 @@ static int record__auxtrace_mmap_read_snapshot(struct record *rec, return ret; if (ret) - rec->samples++; + thread->samples++; return 0; } @@ -1314,7 +1315,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) trigger_ready(&switch_output_trigger); perf_hooks__invoke_record_start(); for (;;) { - unsigned long long hits = rec->samples; + unsigned long long hits = thread->samples; /* * rec->evlist->bkw_mmap_state is possible to be @@ -1383,7 +1384,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) alarm(rec->switch_output.time); } - if (hits == rec->samples) { + if (hits == thread->samples) { if (done || draining) break; err = fdarray__poll(&thread->pollfd, -1); -- 2.13.6