mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Adrian Hunter <adrian.hunter@intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	linux-kernel@vger.kernel.org,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@gmail.com>,
	Paul Mackerras <paulus@samba.org>,
	Stephane Eranian <eranian@google.com>,
	John Stultz <john.stultz@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Pawel Moll <pawel.moll@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Andi Kleen <ak@linux.intel.com>,
	Mathieu Poirier <mathieu.poirier@linaro.org>
Subject: Re: [PATCH V2 1/2] perf: Sample additional clock value
Date: Fri, 20 Feb 2015 10:06:44 -0700	[thread overview]
Message-ID: <54E769A4.2090502@gmail.com> (raw)
In-Reply-To: <1424436249-3572-2-git-send-email-adrian.hunter@intel.com>

On 2/20/15 5:44 AM, Adrian Hunter wrote:
> diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
> index efe2d2d..9385140 100644
> --- a/include/linux/perf_event.h
> +++ b/include/linux/perf_event.h
> @@ -655,7 +655,7 @@ extern void perf_pmu_migrate_context(struct pmu *pmu,
>   				int src_cpu, int dst_cpu);
>   extern u64 perf_event_read_value(struct perf_event *event,
>   				 u64 *enabled, u64 *running);
> -
> +u64 perf_sample_clock_pt(void);

Core functions should not be arch specific. PT == x86.


> @@ -4915,6 +4918,11 @@ perf_output_sample_ustack(struct perf_output_handle *handle, u64 dump_size,
>   	}
>   }
>
> +u64 __weak perf_sample_clock_pt(void)
> +{
> +	return 0;
> +}
> +
>   static void __perf_event_header__init_id(struct perf_event_header *header,
>   					 struct perf_sample_data *data,
>   					 struct perf_event *event)
> @@ -4943,6 +4951,16 @@ static void __perf_event_header__init_id(struct perf_event_header *header,
>   		data->cpu_entry.cpu	 = raw_smp_processor_id();
>   		data->cpu_entry.reserved = 0;
>   	}
> +
> +	if (sample_type & PERF_SAMPLE_CLOCK) {
> +		switch (event->attr.clock) {
> +		case PERF_SAMPLE_CLOCK_PT:
> +			data->clock = perf_sample_clock_pt();
> +			break;
> +		default:
> +			data->clock = 0;
> +		}
> +	}
>   }
>

Ditto here. This should be transparent for arch specific clocks.

David


  reply	other threads:[~2015-02-20 17:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-20 12:44 [PATCH V2 0/2] perf/x86: Add ability to sample TSC Adrian Hunter
2015-02-20 12:44 ` [PATCH V2 1/2] perf: Sample additional clock value Adrian Hunter
2015-02-20 17:06   ` David Ahern [this message]
2015-02-23  7:29     ` Adrian Hunter
2015-02-20 12:44 ` [PATCH V2 2/2] perf/x86: Provide TSC for PERF_SAMPLE_CLOCK_PT Adrian Hunter

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=54E769A4.2090502@gmail.com \
    --to=dsahern@gmail.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=ak@linux.intel.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=john.stultz@linaro.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@gmail.com \
    --cc=paulus@samba.org \
    --cc=pawel.moll@arm.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.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

Powered by JetHome