Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935243AbcKWXGR (ORCPT ); Wed, 23 Nov 2016 18:06:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57186 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753199AbcKWXGO (ORCPT ); Wed, 23 Nov 2016 18:06:14 -0500 Date: Thu, 24 Nov 2016 00:06:09 +0100 From: Jiri Olsa To: kan.liang@intel.com Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, linux-kernel@vger.kernel.org, alexander.shishkin@linux.intel.com, tglx@linutronix.de, namhyung@kernel.org, jolsa@kernel.org, adrian.hunter@intel.com, wangnan0@huawei.com, mark.rutland@arm.com, andi@firstfloor.org Subject: Re: [PATCH 11/14] perf tools: record write data overhead Message-ID: <20161123230609.GH15978@krava> References: <1479894292-16277-1-git-send-email-kan.liang@intel.com> <1479894292-16277-12-git-send-email-kan.liang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1479894292-16277-12-git-send-email-kan.liang@intel.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 23 Nov 2016 23:06:13 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 834 Lines: 33 On Wed, Nov 23, 2016 at 04:44:49AM -0500, kan.liang@intel.com wrote: SNIP > > +static void perf_event__synth_overhead(struct record *rec, perf_event__handler_t process) > +{ > + int cpu; > + > + union perf_event event = { > + .overhead = { > + .header = { > + .type = PERF_RECORD_USER_OVERHEAD, > + .size = sizeof(struct perf_overhead), > + }, > + }, > + }; > + > + event.overhead.type = PERF_USER_WRITE_OVERHEAD; > + > + for (cpu = 0; cpu < MAX_NR_CPUS; cpu++) { > + if (!rec->overhead[cpu].nr) > + continue; > + > + event.overhead.entry.cpu = cpu; > + event.overhead.entry.nr = rec->overhead[cpu].nr; > + event.overhead.entry.time = rec->overhead[cpu].time; > + > + (void)process(&rec->tool, &event, NULL, NULL); plese make perf_event__synth_overhead return int and check above 'process' return value jirka