From: dengcheng.zhu@gmail.com (Deng-Cheng Zhu)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/6] ARM: oprofile: use perf-events framework as backend
Date: Wed, 12 May 2010 12:35:36 +0800 [thread overview]
Message-ID: <4BEA3018.8060600@gmail.com> (raw)
Hi, Will
This is a great idea.
Here's one comment on irq handling (Maybe you or somebody else has already
addressed in other threads - I'm new to this list):
In original Oprofile code, the irq handler mainly does 3 things - clearing
the flag, resetting the counter, and calling oprofile_add_sample(). By
using perf events as the backend of Oprofile, they are now scattered into
a relatively long code path in armpmu->handle_irq(). Could this be
something improvable?
In addition, the counterpart of resetting the counter in perf events is
the armpmu->write_counter() in armpmu_event_set_period(). How could you
make sure the value written into the counter is the same between the
original Oprofile and the "new" Oprofile?
Deng-Cheng
On 2010-04-19 16:42, Will Deacon wrote:
> There are currently two hardware performance monitoring subsystems in the
> kernel for ARM: OProfile and perf-events. This creates the following
problems:
>
> 1.) Duplicate PMU accessor code. Inevitable code drift may lead to
bugs in one
> framework that are fixed in the other.
>
> 2.) Locking issues. OProfile doesn't reprogram hardware counters between
> profiling runs if the events to be monitored have not been changed.
This means
> that other profiling frameworks cannot use the counters if OProfile
is in use.
>
> 3.) Due to differences in the two frameworks, it may not be possible to
> compare the results obtained by OProfile with those obtained by perf.
>
> This patch removes the OProfile PMU driver code and replaces it with
calls
> to perf, therefore solving the issues mentioned above.
>
> +/*
> + * Overflow callback for oprofile.
> + */
> +static void op_overflow_handler(struct perf_event *event, int unused,
> + struct perf_sample_data *data, struct pt_regs *regs)
> +{
> + int id;
> + u32 cpu = smp_processor_id();
> +
> + for (id = 0; id < perf_num_counters; ++id)
> + if (perf_events[cpu][id] == event)
> + break;
> +
> + if (id != perf_num_counters)
> + oprofile_add_sample(regs, id);
> + else
> + pr_warning("oprofile: ignoring spurious overflow "
> + "on cpu %u\n", cpu);
> +}
next reply other threads:[~2010-05-12 4:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-12 4:35 Deng-Cheng Zhu [this message]
2010-05-12 9:32 ` [PATCH 4/6] ARM: oprofile: use perf-events framework as backend Will Deacon
-- strict thread matches above, loose matches on Subject: below --
2010-04-19 16:42 [PATCH 0/6] ARM: oprofile: use perf-events framework as backend [v4] Will Deacon
2010-04-19 16:42 ` [PATCH 1/6] ARM: perf-events: use numeric ID to identify PMU Will Deacon
2010-04-19 16:42 ` [PATCH 2/6] ARM: perf-events: add support for xscale PMUs Will Deacon
2010-04-19 16:42 ` [PATCH 3/6] ARM: perf-events: allow modules to query the number of hardware counters Will Deacon
2010-04-19 16:42 ` [PATCH 4/6] ARM: oprofile: use perf-events framework as backend Will Deacon
2010-04-12 15:04 [PATCH 0/6] ARM: oprofile: use perf-events framework as backend [v3] Will Deacon
2010-04-12 15:04 ` [PATCH 1/6] ARM: perf-events: use numeric ID to identify PMU Will Deacon
2010-04-12 15:04 ` [PATCH 2/6] ARM: perf-events: add support for xscale PMUs Will Deacon
2010-04-12 15:04 ` [PATCH 3/6] perf-events: allow modules to query the maximum number of perf events Will Deacon
2010-04-12 15:04 ` [PATCH 4/6] ARM: oprofile: use perf-events framework as backend Will Deacon
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=4BEA3018.8060600@gmail.com \
--to=dengcheng.zhu@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.