public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: robert.richter@amd•com (Robert Richter)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 7/7] sh: oprofile: Use perf-events oprofile backend
Date: Mon, 11 Oct 2010 13:06:54 +0200	[thread overview]
Message-ID: <20101011110654.GR13563@erda.amd.com> (raw)
In-Reply-To: <a0c83396f5fb8a29baff3daf43d29b2e601511ff.1286584677.git.matt@console-pimps.org>

On 08.10.10 20:46:22, Matt Fleming wrote:
> Now that we've got a generic perf-events based oprofile backend we might
> as well make use of it seeing as SH doesn't do anything special with its
> oprofile backend. Also introduce a new CONFIG_HW_PERF_EVENTS symbol so
> that we can fallback to using the timer interrupt for oprofile if the
> CPU doesn't support perf events.
> 
> Also, to avoid a section mismatch warning we need to annotate
> oprofile_arch_exit() with an __exit marker.
> 
> Signed-off-by: Matt Fleming <matt@console-pimps•org>
> Acked-by: Paul Mundt <lethal@linux-sh•org>
> ---
>  arch/sh/Kconfig            |   13 +++++
>  arch/sh/oprofile/Makefile  |    4 ++
>  arch/sh/oprofile/common.c  |  115 +++++++++-----------------------------------
>  arch/sh/oprofile/op_impl.h |   33 -------------
>  4 files changed, 40 insertions(+), 125 deletions(-)
>  delete mode 100644 arch/sh/oprofile/op_impl.h

> -static int op_sh_create_files(struct super_block *sb, struct dentry *root)
> +char *op_name_from_perf_id(void)
>  {
> -	int i, ret = 0;
> +	const char *pmu;
> +	char buf[20];
> +	int size;
>  
> -	for (i = 0; i < model->num_counters; i++) {
> -		struct dentry *dir;
> -		char buf[4];
> +	pmu = perf_pmu_name();
> +	if (!pmu)
> +		return NULL;
>  
> -		snprintf(buf, sizeof(buf), "%d", i);
> -		dir = oprofilefs_mkdir(sb, root, buf);
> +	size = snprintf(buf, sizeof(buf), "sh/%s", pmu);

Matt and Paul,

are those (upper case) cpu_type strings already supported by the
oprofile userland?

-Robert

> +	if (size > -1 && size < sizeof(buf))
> +		return buf;
>  
> -		ret |= oprofilefs_create_ulong(sb, dir, "enabled", &ctr[i].enabled);
> -		ret |= oprofilefs_create_ulong(sb, dir, "event", &ctr[i].event);
> -		ret |= oprofilefs_create_ulong(sb, dir, "kernel", &ctr[i].kernel);
> -		ret |= oprofilefs_create_ulong(sb, dir, "user", &ctr[i].user);
> -
> -		if (model->create_files)
> -			ret |= model->create_files(sb, dir);
> -		else
> -			ret |= oprofilefs_create_ulong(sb, dir, "count", &ctr[i].count);
> -
> -		/* Dummy entries */
> -		ret |= oprofilefs_create_ulong(sb, dir, "unit_mask", &ctr[i].unit_mask);
> -	}
> -
> -	return ret;
> +	return NULL;
>  }

-- 
Advanced Micro Devices, Inc.
Operating System Research Center

  reply	other threads:[~2010-10-11 11:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-09  0:46 [PATCH V5 0/7] Generalise ARM perf-events backend for oprofile Matt Fleming
2010-10-09  0:46 ` [PATCH 1/7] perf: Add helper function to return number of counters Matt Fleming
2010-10-09  0:46 ` [PATCH 2/7] perf: New helper function for pmu name Matt Fleming
2010-10-11  9:18   ` Robert Richter
2010-10-11  9:31     ` Peter Zijlstra
2010-10-11 15:31   ` Paul Mundt
2010-10-09  0:46 ` [PATCH 3/7] oprofile: Make op_name_from_perf_id() global Matt Fleming
2010-10-09  0:46 ` [PATCH 4/7] ARM: oprofile: Rename op_arm to oprofile_perf Matt Fleming
2010-10-09  0:46 ` [PATCH 5/7] ARM: oprofile: Move non-ARM code into separate init/exit Matt Fleming
2010-10-09  1:26   ` Robert Richter
2010-10-09  1:51     ` Robert Richter
2010-10-09 10:32     ` Matt Fleming
2010-10-09  0:46 ` [PATCH 6/7] oprofile: Abstract the perf-events backend Matt Fleming
2010-10-09  0:46 ` [PATCH 7/7] sh: oprofile: Use perf-events oprofile backend Matt Fleming
2010-10-11 11:06   ` Robert Richter [this message]
2010-10-11 11:09     ` Paul Mundt
2010-10-11 18:59 ` [PATCH V5 0/7] Generalise ARM perf-events backend for oprofile Robert Richter
2010-10-11 20:13   ` Matt Fleming

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=20101011110654.GR13563@erda.amd.com \
    --to=robert.richter@amd$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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