Messages in this thread Patch in this message | | | Date | Thu, 05 Apr 2012 10:59:04 -0600 | From | David Ahern <> | Subject | Re: [PATCH 4/4] perf tools: Use sw counter only if hw pmu is not detected |
| |
On 4/5/12 10:26 AM, Robert Richter wrote: > Use cpu-clock-tick sw counter for cpu-cycles only if there is no hw > pmu available. This is the case if the syscall reports ENOENT. In > other cases (e.g. invalid attributes) we don't want the sw counter to > be used.
Isn't the invalid attributes case handled by the '} else if (err == EINVAL) {' case before this switch is done?
David
> > Signed-off-by: Robert Richter<robert.richter@amd.com> > --- > tools/perf/builtin-record.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c > index be4e1ee..10b1f1f 100644 > --- a/tools/perf/builtin-record.c > +++ b/tools/perf/builtin-record.c > @@ -245,7 +245,7 @@ try_again: > * based cpu-clock-tick sw counter, which > * is always available even if no PMU support: > */ > - if (attr->type == PERF_TYPE_HARDWARE > + if (err == ENOENT&& attr->type == PERF_TYPE_HARDWARE > && attr->config == PERF_COUNT_HW_CPU_CYCLES) { > > if (verbose)
| |