From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752080AbcGUHrp (ORCPT ); Thu, 21 Jul 2016 03:47:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40308 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751821AbcGUHrl (ORCPT ); Thu, 21 Jul 2016 03:47:41 -0400 Date: Thu, 21 Jul 2016 09:47:38 +0200 From: Jiri Olsa To: Mathieu Poirier Cc: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH V2 4/6] perf tools: pushing driver configuration down to the kernel Message-ID: <20160721074738.GD7192@krava> References: <1469047100-18131-1-git-send-email-mathieu.poirier@linaro.org> <1469047100-18131-5-git-send-email-mathieu.poirier@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1469047100-18131-5-git-send-email-mathieu.poirier@linaro.org> User-Agent: Mutt/1.6.2 (2016-07-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 21 Jul 2016 07:47:41 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 20, 2016 at 02:38:18PM -0600, Mathieu Poirier wrote: > Now that PMU specific driver configuration are queued in > evsel::drv_config_terms, all we need to do is re-use the current > ioctl() mechanism to push down the information to the kernel > driver. > > Signed-off-by: Mathieu Poirier > --- > tools/perf/builtin-record.c | 9 +++++++++ > tools/perf/util/evlist.c | 24 ++++++++++++++++++++++++ > tools/perf/util/evlist.h | 3 +++ > tools/perf/util/evsel.c | 32 ++++++++++++++++++++++++++++++++ > tools/perf/util/evsel.h | 3 +++ > 5 files changed, 71 insertions(+) > > diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c > index 8f2c16d9275f..dffea1033b8e 100644 > --- a/tools/perf/builtin-record.c > +++ b/tools/perf/builtin-record.c > @@ -383,6 +383,7 @@ static int record__open(struct record *rec) > struct perf_evlist *evlist = rec->evlist; > struct perf_session *session = rec->session; > struct record_opts *opts = &rec->opts; > + struct perf_evsel_config_term *err_term; > int rc = 0; > > perf_evlist__config(evlist, opts, &callchain_param); > @@ -412,6 +413,14 @@ try_again: > goto out; > } > > + if (perf_evlist__apply_drv_configs(evlist, &pos, &err_term)) { > + error("failed to set config \"%s\" on event %s with %d (%s)\n", > + err_term->val.drv_cfg, perf_evsel__name(pos), errno, > + strerror_r(errno, msg, sizeof(msg))); > + rc = -1; > + goto out; > + } > + how about 'perf top' and 'perf stat', should they support this too? thanks, jirka