RE: [PATCH V5 12/17] perf evsel: expose perf_missing_features.write_backward
> Em Thu, Jan 18, 2018 at 01:26:27PM -0800, kan.li...@intel.com escreveu: > > From: Kan Liang> > > > perf top need it to handle overwrite fallback later. > > > > Signed-off-by: Kan Liang > > --- > > tools/perf/util/evsel.c | 5 + > > tools/perf/util/evsel.h | 2 ++ > > 2 files changed, 7 insertions(+) > > > > diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index > > 4eea3b4..1dd3700 100644 > > --- a/tools/perf/util/evsel.c > > +++ b/tools/perf/util/evsel.c > > @@ -1670,6 +1670,11 @@ static bool ignore_missing_thread(struct > perf_evsel *evsel, > > return true; > > } > > > > +bool is_write_backward_fail(void) > > +{ > > + return perf_missing_features.write_backward; > > +} > > + > > Humm, I think we better expose perf_missing_features, i.e. tools using > > if (perf_missing_features.write_backward) > It looks good. Thanks a lot. Kan > looks more clear than: > > if (is_write_backward_fail()) > > This is minor, so I'm doing this myself, please holler if you disagree. > > - Arnaldo > > > int perf_evsel__open(struct perf_evsel *evsel, struct cpu_map *cpus, > > struct thread_map *threads) > > { > > diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index > > 846e416..1f46728 100644 > > --- a/tools/perf/util/evsel.h > > +++ b/tools/perf/util/evsel.h > > @@ -448,4 +448,6 @@ int perf_event_attr__fprintf(FILE *fp, struct > > perf_event_attr *attr, > > > > struct perf_env *perf_evsel__env(struct perf_evsel *evsel); > > > > +bool is_write_backward_fail(void); > > + > > #endif /* __PERF_EVSEL_H */ > > -- > > 2.5.5
RE: [PATCH V5 12/17] perf evsel: expose perf_missing_features.write_backward
> Em Thu, Jan 18, 2018 at 01:26:27PM -0800, kan.li...@intel.com escreveu: > > From: Kan Liang > > > > perf top need it to handle overwrite fallback later. > > > > Signed-off-by: Kan Liang > > --- > > tools/perf/util/evsel.c | 5 + > > tools/perf/util/evsel.h | 2 ++ > > 2 files changed, 7 insertions(+) > > > > diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index > > 4eea3b4..1dd3700 100644 > > --- a/tools/perf/util/evsel.c > > +++ b/tools/perf/util/evsel.c > > @@ -1670,6 +1670,11 @@ static bool ignore_missing_thread(struct > perf_evsel *evsel, > > return true; > > } > > > > +bool is_write_backward_fail(void) > > +{ > > + return perf_missing_features.write_backward; > > +} > > + > > Humm, I think we better expose perf_missing_features, i.e. tools using > > if (perf_missing_features.write_backward) > It looks good. Thanks a lot. Kan > looks more clear than: > > if (is_write_backward_fail()) > > This is minor, so I'm doing this myself, please holler if you disagree. > > - Arnaldo > > > int perf_evsel__open(struct perf_evsel *evsel, struct cpu_map *cpus, > > struct thread_map *threads) > > { > > diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index > > 846e416..1f46728 100644 > > --- a/tools/perf/util/evsel.h > > +++ b/tools/perf/util/evsel.h > > @@ -448,4 +448,6 @@ int perf_event_attr__fprintf(FILE *fp, struct > > perf_event_attr *attr, > > > > struct perf_env *perf_evsel__env(struct perf_evsel *evsel); > > > > +bool is_write_backward_fail(void); > > + > > #endif /* __PERF_EVSEL_H */ > > -- > > 2.5.5
Re: [PATCH V5 12/17] perf evsel: expose perf_missing_features.write_backward
Em Thu, Jan 18, 2018 at 01:26:27PM -0800, kan.li...@intel.com escreveu: > From: Kan Liang> > perf top need it to handle overwrite fallback later. > > Signed-off-by: Kan Liang > --- > tools/perf/util/evsel.c | 5 + > tools/perf/util/evsel.h | 2 ++ > 2 files changed, 7 insertions(+) > > diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c > index 4eea3b4..1dd3700 100644 > --- a/tools/perf/util/evsel.c > +++ b/tools/perf/util/evsel.c > @@ -1670,6 +1670,11 @@ static bool ignore_missing_thread(struct perf_evsel > *evsel, > return true; > } > > +bool is_write_backward_fail(void) > +{ > + return perf_missing_features.write_backward; > +} > + Humm, I think we better expose perf_missing_features, i.e. tools using if (perf_missing_features.write_backward) looks more clear than: if (is_write_backward_fail()) This is minor, so I'm doing this myself, please holler if you disagree. - Arnaldo > int perf_evsel__open(struct perf_evsel *evsel, struct cpu_map *cpus, >struct thread_map *threads) > { > diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h > index 846e416..1f46728 100644 > --- a/tools/perf/util/evsel.h > +++ b/tools/perf/util/evsel.h > @@ -448,4 +448,6 @@ int perf_event_attr__fprintf(FILE *fp, struct > perf_event_attr *attr, > > struct perf_env *perf_evsel__env(struct perf_evsel *evsel); > > +bool is_write_backward_fail(void); > + > #endif /* __PERF_EVSEL_H */ > -- > 2.5.5
Re: [PATCH V5 12/17] perf evsel: expose perf_missing_features.write_backward
Em Thu, Jan 18, 2018 at 01:26:27PM -0800, kan.li...@intel.com escreveu: > From: Kan Liang > > perf top need it to handle overwrite fallback later. > > Signed-off-by: Kan Liang > --- > tools/perf/util/evsel.c | 5 + > tools/perf/util/evsel.h | 2 ++ > 2 files changed, 7 insertions(+) > > diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c > index 4eea3b4..1dd3700 100644 > --- a/tools/perf/util/evsel.c > +++ b/tools/perf/util/evsel.c > @@ -1670,6 +1670,11 @@ static bool ignore_missing_thread(struct perf_evsel > *evsel, > return true; > } > > +bool is_write_backward_fail(void) > +{ > + return perf_missing_features.write_backward; > +} > + Humm, I think we better expose perf_missing_features, i.e. tools using if (perf_missing_features.write_backward) looks more clear than: if (is_write_backward_fail()) This is minor, so I'm doing this myself, please holler if you disagree. - Arnaldo > int perf_evsel__open(struct perf_evsel *evsel, struct cpu_map *cpus, >struct thread_map *threads) > { > diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h > index 846e416..1f46728 100644 > --- a/tools/perf/util/evsel.h > +++ b/tools/perf/util/evsel.h > @@ -448,4 +448,6 @@ int perf_event_attr__fprintf(FILE *fp, struct > perf_event_attr *attr, > > struct perf_env *perf_evsel__env(struct perf_evsel *evsel); > > +bool is_write_backward_fail(void); > + > #endif /* __PERF_EVSEL_H */ > -- > 2.5.5
[PATCH V5 12/17] perf evsel: expose perf_missing_features.write_backward
From: Kan Liangperf top need it to handle overwrite fallback later. Signed-off-by: Kan Liang --- tools/perf/util/evsel.c | 5 + tools/perf/util/evsel.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 4eea3b4..1dd3700 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -1670,6 +1670,11 @@ static bool ignore_missing_thread(struct perf_evsel *evsel, return true; } +bool is_write_backward_fail(void) +{ + return perf_missing_features.write_backward; +} + int perf_evsel__open(struct perf_evsel *evsel, struct cpu_map *cpus, struct thread_map *threads) { diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 846e416..1f46728 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -448,4 +448,6 @@ int perf_event_attr__fprintf(FILE *fp, struct perf_event_attr *attr, struct perf_env *perf_evsel__env(struct perf_evsel *evsel); +bool is_write_backward_fail(void); + #endif /* __PERF_EVSEL_H */ -- 2.5.5
[PATCH V5 12/17] perf evsel: expose perf_missing_features.write_backward
From: Kan Liang perf top need it to handle overwrite fallback later. Signed-off-by: Kan Liang --- tools/perf/util/evsel.c | 5 + tools/perf/util/evsel.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 4eea3b4..1dd3700 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -1670,6 +1670,11 @@ static bool ignore_missing_thread(struct perf_evsel *evsel, return true; } +bool is_write_backward_fail(void) +{ + return perf_missing_features.write_backward; +} + int perf_evsel__open(struct perf_evsel *evsel, struct cpu_map *cpus, struct thread_map *threads) { diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 846e416..1f46728 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -448,4 +448,6 @@ int perf_event_attr__fprintf(FILE *fp, struct perf_event_attr *attr, struct perf_env *perf_evsel__env(struct perf_evsel *evsel); +bool is_write_backward_fail(void); + #endif /* __PERF_EVSEL_H */ -- 2.5.5