Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751570AbbHTJkE (ORCPT ); Thu, 20 Aug 2015 05:40:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50348 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751265AbbHTJkB (ORCPT ); Thu, 20 Aug 2015 05:40:01 -0400 Date: Thu, 20 Aug 2015 11:39:58 +0200 From: Jiri Olsa To: kan.liang@intel.com Cc: acme@kernel.org, a.p.zijlstra@chello.nl, mingo@redhat.com, jolsa@kernel.org, namhyung@kernel.org, ak@linux.intel.com, eranian@google.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC 05/10] perf,tools: Enable statistic read for perf record Message-ID: <20150820093958.GB4640@krava.brq.redhat.com> References: <1439889946-28986-1-git-send-email-kan.liang@intel.com> <1439889946-28986-6-git-send-email-kan.liang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1439889946-28986-6-git-send-email-kan.liang@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1298 Lines: 43 On Tue, Aug 18, 2015 at 05:25:41AM -0400, kan.liang@intel.com wrote: SNIP > evlist__for_each(evlist, pos) { > + > + if (pos->stat_read) { > + if (!target__has_cpu(&opts->target)) { > + pos->stat_read = 0; > + ui__warning("Statistics read only available " > + "on system-wide/CPU mode. " > + "Remove :N modifier for event %s\n", > + pos->name); > + goto out; > + } > + /* Don't do stat read for Group leader */ > + if ((pos->leader == pos) && (pos->leader->nr_members > 1)) > + pos->stat_read = 0; > + else { > + if (first == pos) { > + pos->stat_read = 0; > + ui__warning("The first event cannot " > + "be stat read event\n"); > + goto out; > + } > + attr = &pos->attr; > + attr->read_format = PERF_FORMAT_TOTAL_TIME_ENABLED | > + PERF_FORMAT_TOTAL_TIME_RUNNING; > + attr->sample_freq = 0; > + attr->sample_period = 0; > + attr->sample_type = 0; > + pos->sample_size = 0; > + } > + } seems like this should go under perf_evsel__config jirka -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/