linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] ARM: perf: armv7: wrap unsupported arch init functions via micro
Date: Wed, 22 Oct 2014 12:01:28 +0100	[thread overview]
Message-ID: <20141022110128.GE22642@leverpostej> (raw)
In-Reply-To: <1413966107-11881-2-git-send-email-chaiw.fnst@cn.fujitsu.com>

Hi,

On Wed, Oct 22, 2014 at 09:21:47AM +0100, chai wen wrote:
> Signed-off-by: chai wen <chaiw.fnst@cn.fujitsu.com>
> ---
>  arch/arm/kernel/perf_event_v7.c |   52 +++++++++-----------------------------
>  1 files changed, 13 insertions(+), 39 deletions(-)

I'm currently in the process of decoupling perf_event_{xscale,v6,v7}.c,
which will result in the removal of these stubs and for the ARMv7,
ARMv6, and XScale perf backends.

I haven't yet posted all the patches, but the basic idea is to make the
arm_pmu code stateless and turn it into a library used by each of the
three backends mentioned above. Each would have their own pmu_probe_info
table (introduced in [1]), and would support the platform device IDs
introduced in commit 253d8c3d2518ca6f (arm: perf: add more specific
platform device IDs). The stubs would no longer be necessary.

[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2014-October/295822.html

Thanks,
Mark.

> 
> diff --git a/arch/arm/kernel/perf_event_v7.c b/arch/arm/kernel/perf_event_v7.c
> index f66a9b8..6c088e8 100644
> --- a/arch/arm/kernel/perf_event_v7.c
> +++ b/arch/arm/kernel/perf_event_v7.c
> @@ -1459,43 +1459,17 @@ static int krait_pmu_init(struct arm_pmu *cpu_pmu)
>  	return 0;
>  }
>  #else
> -static inline int armv7_a8_pmu_init(struct arm_pmu *cpu_pmu)
> -{
> -	return -ENODEV;
> -}
> -
> -static inline int armv7_a9_pmu_init(struct arm_pmu *cpu_pmu)
> -{
> -	return -ENODEV;
> -}
> -
> -static inline int armv7_a5_pmu_init(struct arm_pmu *cpu_pmu)
> -{
> -	return -ENODEV;
> -}
> -
> -static inline int armv7_a15_pmu_init(struct arm_pmu *cpu_pmu)
> -{
> -	return -ENODEV;
> -}
> -
> -static inline int armv7_a7_pmu_init(struct arm_pmu *cpu_pmu)
> -{
> -	return -ENODEV;
> -}
> -
> -static inline int armv7_a12_pmu_init(struct arm_pmu *cpu_pmu)
> -{
> -	return -ENODEV;
> -}
> -
> -static inline int armv7_a17_pmu_init(struct arm_pmu *cpu_pmu)
> -{
> -	return -ENODEV;
> -}
> -
> -static inline int krait_pmu_init(struct arm_pmu *cpu_pmu)
> -{
> -	return -ENODEV;
> -}
> +#define WRAP_UNSUPPORTED_INIT(__FUNC)                           \
> +static inline int __FUNC(struct arm_pmu *cpu_pmu)               \
> +{                                                               \
> +        return -ENODEV;                                         \
> +}
> +WRAP_UNSUPPORTED_INIT(armv7_a8_pmu_init);
> +WRAP_UNSUPPORTED_INIT(armv7_a9_pmu_init);
> +WRAP_UNSUPPORTED_INIT(armv7_a5_pmu_init);
> +WRAP_UNSUPPORTED_INIT(armv7_a15_pmu_init);
> +WRAP_UNSUPPORTED_INIT(armv7_a7_pmu_init);
> +WRAP_UNSUPPORTED_INIT(armv7_a12_pmu_init);
> +WRAP_UNSUPPORTED_INIT(armv7_a17_pmu_init);
> +WRAP_UNSUPPORTED_INIT(krait_pmu_init);
>  #endif	/* CONFIG_CPU_V7 */
> -- 
> 1.7.1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

  reply	other threads:[~2014-10-22 11:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-22  8:21 [PATCH 1/2] ARM: perf: armv7 remove useless return and check of idx in counter handling chai wen
2014-10-22  8:21 ` [PATCH 2/2] ARM: perf: armv7: wrap unsupported arch init functions via micro chai wen
2014-10-22 11:01   ` Mark Rutland [this message]
2014-10-22 11:22     ` Chai Wen
2014-10-22 10:47 ` [PATCH 1/2] ARM: perf: armv7 remove useless return and check of idx in counter handling Mark Rutland
2014-10-22 11:26   ` Chai Wen

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=20141022110128.GE22642@leverpostej \
    --to=mark.rutland@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).