Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753257AbcLFLRg (ORCPT ); Tue, 6 Dec 2016 06:17:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48046 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751327AbcLFLRc (ORCPT ); Tue, 6 Dec 2016 06:17:32 -0500 Date: Tue, 6 Dec 2016 12:16:31 +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 V2 08/13] perf tools: show kernel overhead Message-ID: <20161206111631.GD7730@krava> References: <1480713561-6617-1-git-send-email-kan.liang@intel.com> <1480713561-6617-9-git-send-email-kan.liang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1480713561-6617-9-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.29]); Tue, 06 Dec 2016 11:16:34 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1537 Lines: 47 On Fri, Dec 02, 2016 at 04:19:16PM -0500, kan.liang@intel.com wrote: SNIP > diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c > index 02c8f7a..72c4412 100644 > --- a/tools/perf/util/machine.c > +++ b/tools/perf/util/machine.c > @@ -557,9 +557,31 @@ int machine__process_switch_event(struct machine *machine __maybe_unused, > > int machine__process_overhead_event(struct machine *machine __maybe_unused, > union perf_event *event, > - struct perf_sample *sample __maybe_unused) > -{ > - dump_printf("\tUNSUPPORT TYPE 0x%lx!\n", event->overhead.type); > + struct perf_sample *sample) > +{ > + switch (event->overhead.type) { > + case PERF_PMU_SAMPLE_OVERHEAD: > + dump_printf(" SAMPLE nr: %llu time: %llu cpu %d\n", > + event->overhead.entry.nr, > + event->overhead.entry.time, > + sample->cpu); > + break; > + case PERF_CORE_MUX_OVERHEAD: > + dump_printf(" MULTIPLEXING nr: %llu time: %llu cpu %d\n", > + event->overhead.entry.nr, > + event->overhead.entry.time, > + sample->cpu); > + break; > + case PERF_CORE_SB_OVERHEAD: > + dump_printf(" SIDE-BAND nr: %llu time: %llu cpu %d\n", > + event->overhead.entry.nr, > + event->overhead.entry.time, > + sample->cpu); > + break; > + default: > + dump_printf("\tUNSUPPORT TYPE 0x%lx!\n", event->overhead.type); > + return 0; > + } > return 0; normaly we call here perf_event__fprintf handlers, which you're adding in the following patch.. above code seems redundant thanks, jirka