Linux-perf-users Archive on lore.kernel.org
 help / color / Atom feed
From: kajoljain <kjain@linux.ibm.com>
To: Jiri Olsa <jolsa@redhat.com>
Cc: acme@kernel.org, peterz@infradead.org, mingo@redhat.com,
	mark.rutland@arm.com, alexander.shishkin@linux.intel.com,
	pc@us.ibm.com, namhyung@kernel.org, ak@linux.intel.com,
	yao.jin@linux.intel.com, linux-kernel@vger.kernel.org,
	linux-perf-users@vger.kernel.org, irogers@google.com,
	maddy@linux.ibm.com, ravi.bangoria@linux.ibm.com,
	john.garry@huawei.com
Subject: Re: [PATCH v8 3/5] perf jevents: Add support for parsing perchip/percore events
Date: Mon, 7 Sep 2020 12:10:05 +0530
Message-ID: <c414cdac-9051-5e0f-b638-3c3cca5394a6@linux.ibm.com> (raw)
In-Reply-To: <20200906125552.GC1199773@krava>



On 9/6/20 6:25 PM, Jiri Olsa wrote:
> On Sun, Sep 06, 2020 at 04:50:02PM +0530, Kajol Jain wrote:
> 
> SNIP
> 
>>  typedef int (*func)(void *data, struct json_event *je);
>>  
>>  int eprintf(int level, int var, const char *fmt, ...)
>> @@ -355,6 +368,8 @@ static int print_events_table_entry(void *data, struct json_event *je)
>>  		fprintf(outfp, "\t.unit = \"%s\",\n", je->unit);
>>  	if (je->perpkg)
>>  		fprintf(outfp, "\t.perpkg = \"%s\",\n", je->perpkg);
>> +	if (je->aggr_mode)
>> +		fprintf(outfp, "\t.aggr_mode = \"%d\",\n", convert(je->aggr_mode));
>>  	if (je->metric_expr)
>>  		fprintf(outfp, "\t.metric_expr = \"%s\",\n", je->metric_expr);
>>  	if (je->metric_name)
>> @@ -379,6 +394,7 @@ struct event_struct {
>>  	char *pmu;
>>  	char *unit;
>>  	char *perpkg;
>> +	char *aggr_mode;
>>  	char *metric_expr;
>>  	char *metric_name;
>>  	char *metric_group;
>> @@ -408,6 +424,7 @@ struct event_struct {
>>  	op(pmu);						\
>>  	op(unit);						\
>>  	op(perpkg);						\
>> +	op(aggr_mode);						\
>>  	op(metric_expr);					\
>>  	op(metric_name);					\
>>  	op(metric_group);					\
>> @@ -613,6 +630,8 @@ static int json_events(const char *fn,
>>  				addfield(map, &je.unit, "", "", val);
>>  			} else if (json_streq(map, field, "PerPkg")) {
>>  				addfield(map, &je.perpkg, "", "", val);
>> +			} else if (json_streq(map, field, "AggregationMode")) {
>> +				addfield(map, &je.aggr_mode, "", "", val);
> 
> I think you should free je.aggr_mode

My bad, missed that part. Will send updated one.

Thanks,
Kajol Jain
> 
> jirka
> 
>>  			} else if (json_streq(map, field, "Deprecated")) {
>>  				addfield(map, &je.deprecated, "", "", val);
>>  			} else if (json_streq(map, field, "MetricName")) {
>> diff --git a/tools/perf/pmu-events/pmu-events.h b/tools/perf/pmu-events/pmu-events.h
>> index c8f306b572f4..7da1a3743b77 100644
>> --- a/tools/perf/pmu-events/pmu-events.h
>> +++ b/tools/perf/pmu-events/pmu-events.h
>> @@ -2,6 +2,11 @@
>>  #ifndef PMU_EVENTS_H
>>  #define PMU_EVENTS_H
>>  
>> +enum aggr_mode_class {
>> +	PerChip = 1,
>> +	PerCore
>> +};
>> +
>>  /*
>>   * Describe each PMU event. Each CPU has a table of PMU events.
>>   */
>> @@ -14,6 +19,7 @@ struct pmu_event {
>>  	const char *pmu;
>>  	const char *unit;
>>  	const char *perpkg;
>> +	const char *aggr_mode;
>>  	const char *metric_expr;
>>  	const char *metric_name;
>>  	const char *metric_group;
>> -- 
>> 2.26.2
>>
> 

  reply index

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-06 11:19 [PATCH v8 0/5] powerpc/perf: Add json file support for hv_24x7 core level events Kajol Jain
2020-09-06 11:20 ` [PATCH v8 1/5] perf/jevents: Remove jevents.h file Kajol Jain
2020-09-06 11:20 ` [PATCH v8 2/5] perf/jevents: Add new structure to pass json fields Kajol Jain
2020-09-06 11:20 ` [PATCH v8 3/5] perf jevents: Add support for parsing perchip/percore events Kajol Jain
2020-09-06 12:55   ` Jiri Olsa
2020-09-07  6:40     ` kajoljain [this message]
2020-09-06 11:20 ` [PATCH v8 4/5] perf/tools: Pass pmu_event structure as a parameter for arch_get_runtimeparam Kajol Jain
2020-09-06 11:20 ` [PATCH v8 5/5] perf/tools/pmu_events/powerpc: Add hv_24x7 core level metric events Kajol Jain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c414cdac-9051-5e0f-b638-3c3cca5394a6@linux.ibm.com \
    --to=kjain@linux.ibm.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=john.garry@huawei.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=maddy@linux.ibm.com \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=pc@us.ibm.com \
    --cc=peterz@infradead.org \
    --cc=ravi.bangoria@linux.ibm.com \
    --cc=yao.jin@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-perf-users Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-perf-users/0 linux-perf-users/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-perf-users linux-perf-users/ https://lore.kernel.org/linux-perf-users \
		linux-perf-users@vger.kernel.org
	public-inbox-index linux-perf-users

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-perf-users


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git