public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Jiri Olsa <jolsa@redhat.com>
Cc: kan.liang@intel.com, mingo@redhat.com,
	linux-kernel@vger.kernel.org, peterz@infradead.org,
	eranian@google.com, tglx@linutronix.de, ak@linux.intel.com
Subject: Re: [PATCH V2 1/5] perf tools: support new sample type for physical address
Date: Fri, 1 Sep 2017 12:36:20 -0300	[thread overview]
Message-ID: <20170901153620.GL4831@kernel.org> (raw)
In-Reply-To: <20170901152814.GA21673@krava.homenet.telecomitalia.it>

Em Fri, Sep 01, 2017 at 05:28:27PM +0200, Jiri Olsa escreveu:
> On Tue, Aug 29, 2017 at 01:11:08PM -0400, kan.liang@intel.com wrote:
> 
> SNIP
> 
> > diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
> > index a5888c7..228a78d 100644
> > --- a/tools/perf/util/evsel.c
> > +++ b/tools/perf/util/evsel.c
> > @@ -950,6 +950,9 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts,
> >  	if (opts->sample_address)
> >  		perf_evsel__set_sample_bit(evsel, DATA_SRC);
> >  
> > +	if (opts->sample_phys_addr)
> > +		perf_evsel__set_sample_bit(evsel, PHYS_ADDR);
> > +
> >  	if (opts->no_buffering) {
> >  		attr->watermark = 0;
> >  		attr->wakeup_events = 1;
> > @@ -2201,6 +2204,12 @@ int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event,
> >  		}
> >  	}
> >  
> > +	data->phys_addr = 0;
> > +	if (type & PERF_SAMPLE_PHYS_ADDR) {
> > +		data->phys_addr = *array;
> > +		array++;
> > +	}
> > +
> >  	return 0;
> >  }
> >  
> > @@ -2306,6 +2315,9 @@ size_t perf_event__sample_event_size(const struct perf_sample *sample, u64 type,
> >  		}
> >  	}
> >  
> > +	if (type & PERF_SAMPLE_PHYS_ADDR)
> > +		result += sizeof(u64);
> > +
> >  	return result;
> >  }
> >  
> > @@ -2495,6 +2507,11 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type,
> >  		}
> >  	}
> >  
> > +	if (type & PERF_SAMPLE_PHYS_ADDR) {
> > +		*array = sample->phys_addr;
> > +		array++;
> > +	}
> > +
> >  	return 0;
> >  }
> >  
> 
> missing the printing bits

I'm folding this one there then,

- Arnaldo
 
> jirka
> 
> 
> diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
> index e705c0d59a69..4bb89373eb52 100644
> --- a/tools/perf/util/evsel.c
> +++ b/tools/perf/util/evsel.c
> @@ -1467,7 +1467,7 @@ static void __p_sample_type(char *buf, size_t size, u64 value)
>  		bit_name(PERIOD), bit_name(STREAM_ID), bit_name(RAW),
>  		bit_name(BRANCH_STACK), bit_name(REGS_USER), bit_name(STACK_USER),
>  		bit_name(IDENTIFIER), bit_name(REGS_INTR), bit_name(DATA_SRC),
> -		bit_name(WEIGHT),
> +		bit_name(WEIGHT), bit_name(PHYS_ADDR),
>  		{ .name = NULL, }
>  	};
>  #undef bit_name

  reply	other threads:[~2017-09-01 15:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-29 17:11 [PATCH V2 0/5] support PERF_SAMPLE_PHYS_ADDR (user) kan.liang
2017-08-29 17:11 ` [PATCH V2 1/5] perf tools: support new sample type for physical address kan.liang
2017-09-01 15:28   ` Jiri Olsa
2017-09-01 15:36     ` Arnaldo Carvalho de Melo [this message]
2017-09-05  5:21   ` [tip:perf/urgent] perf tools: Support " tip-bot for Kan Liang
2017-08-29 17:11 ` [PATCH V2 2/5] perf tools: add sort option " kan.liang
2017-09-05  5:21   ` [tip:perf/urgent] perf sort: Add " tip-bot for Kan Liang
2017-08-29 17:11 ` [PATCH V2 3/5] perf mem: support " kan.liang
2017-09-05  5:22   ` [tip:perf/urgent] perf mem: Support " tip-bot for Kan Liang
2017-08-29 17:11 ` [PATCH V2 4/5] perf script: support " kan.liang
2017-09-05  5:22   ` [tip:perf/urgent] perf script: Support " tip-bot for Kan Liang
2017-08-29 17:11 ` [PATCH V2 5/5] perf test: add test case for PERF_SAMPLE_PHYS_ADDR kan.liang
2017-09-05  5:23   ` [tip:perf/urgent] perf test: Add " tip-bot for Kan Liang
2017-09-01 15:45 ` [PATCH V2 0/5] support PERF_SAMPLE_PHYS_ADDR (user) Jiri Olsa
2017-09-01 17:39   ` Arnaldo Carvalho de Melo
2017-09-01 17:46     ` Jiri Olsa

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=20170901153620.GL4831@kernel.org \
    --to=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=eranian@google.com \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox