Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752203AbbG2Ls7 (ORCPT ); Wed, 29 Jul 2015 07:48:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32982 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752013AbbG2Ls5 (ORCPT ); Wed, 29 Jul 2015 07:48:57 -0400 Date: Wed, 29 Jul 2015 13:48:55 +0200 From: Jiri Olsa To: Kan Liang Cc: acme@kernel.org, jolsa@kernel.org, namhyung@kernel.org, ak@linux.intel.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC V6 5/6] perf,tool: per-event callgraph support Message-ID: <20150729114855.GC9606@krava.brq.redhat.com> References: <1437999699-19632-1-git-send-email-kan.liang@intel.com> <1437999699-19632-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: <1437999699-19632-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: 1946 Lines: 56 On Mon, Jul 27, 2015 at 08:21:38AM -0400, Kan Liang wrote: SNIP > > -static void apply_config_terms(struct perf_evsel *evsel) > +static void apply_config_terms(struct perf_evsel *evsel, > + struct record_opts *opts) > { > struct perf_evsel_config_term *term; > struct list_head *config_terms = &evsel->config_terms; > struct perf_event_attr *attr = &evsel->attr; > + struct callchain_param param; > + bool callgraph_set = false; > + > + /* callgraph default */ > + param.record_mode = callchain_param.record_mode; > + param.dump_size = 8192; > > list_for_each_entry(term, config_terms, list) { > switch (term->type) { > @@ -604,10 +612,49 @@ static void apply_config_terms(struct perf_evsel *evsel) > else > perf_evsel__reset_sample_bit(evsel, TIME); > break; > + case PERF_EVSEL__CONFIG_TERM_CALLGRAPH: > + if (!strcmp(term->val.callgraph, "fp")) { > + param.enabled = true; > + param.record_mode = CALLCHAIN_FP; > + } else if (!strcmp(term->val.callgraph, "dwarf")) { > + param.enabled = true; > + param.record_mode = CALLCHAIN_DWARF; > + } else if (!strcmp(term->val.callgraph, "lbr")) { > + param.enabled = true; > + param.record_mode = CALLCHAIN_LBR; > + } else if (!strcmp(term->val.callgraph, "no")) { > + param.enabled = false; > + } else { > + pr_warning("%s is no valid callchain type.\n", term->val.callgraph); > + } > + callgraph_set = true; > + break; > + case PERF_EVSEL__CONFIG_TERM_STACK_USER: > + param.dump_size = term->val.stack_user; > + callgraph_set = true; > + break; could this get somehow unified with parse_callchain_record_opt? it'd be nice to have this setup on single place.. 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/