2021-05-19 19:10:25

by Leo Yan

[permalink] [raw]
Subject: [PATCH v2 4/4] perf arm-spe: Remove redundant checking for "full_auxtrace"

The option "opts->full_auxtrace" is checked at the earlier place, if it
is false the function will directly bail out. So remove the redundant
checking for "opts->full_auxtrace".

Suggested-by: James Clark <[email protected]>
Signed-off-by: Leo Yan <[email protected]>
---
tools/perf/arch/arm64/util/arm-spe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/arch/arm64/util/arm-spe.c b/tools/perf/arch/arm64/util/arm-spe.c
index bacdf366040d..a4420d4df503 100644
--- a/tools/perf/arch/arm64/util/arm-spe.c
+++ b/tools/perf/arch/arm64/util/arm-spe.c
@@ -116,7 +116,7 @@ static int arm_spe_recording_options(struct auxtrace_record *itr,
return 0;

/* We are in full trace mode but '-m,xyz' wasn't specified */
- if (opts->full_auxtrace && !opts->auxtrace_mmap_pages) {
+ if (!opts->auxtrace_mmap_pages) {
if (privileged) {
opts->auxtrace_mmap_pages = MiB(4) / page_size;
} else {
--
2.25.1



2021-05-25 15:19:52

by James Clark

[permalink] [raw]
Subject: Re: [PATCH v2 4/4] perf arm-spe: Remove redundant checking for "full_auxtrace"



On 19/05/2021 07:15, Leo Yan wrote:
> The option "opts->full_auxtrace" is checked at the earlier place, if it
> is false the function will directly bail out. So remove the redundant
> checking for "opts->full_auxtrace".
>
> Suggested-by: James Clark <[email protected]>
> Signed-off-by: Leo Yan <[email protected]>
> ---
> tools/perf/arch/arm64/util/arm-spe.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/arch/arm64/util/arm-spe.c b/tools/perf/arch/arm64/util/arm-spe.c
> index bacdf366040d..a4420d4df503 100644
> --- a/tools/perf/arch/arm64/util/arm-spe.c
> +++ b/tools/perf/arch/arm64/util/arm-spe.c
> @@ -116,7 +116,7 @@ static int arm_spe_recording_options(struct auxtrace_record *itr,
> return 0;
>
> /* We are in full trace mode but '-m,xyz' wasn't specified */
> - if (opts->full_auxtrace && !opts->auxtrace_mmap_pages) {
> + if (!opts->auxtrace_mmap_pages) {
> if (privileged) {
> opts->auxtrace_mmap_pages = MiB(4) / page_size;
> } else {
>

Reviewed-by: James Clark <[email protected]>

Thanks
James

2021-05-25 15:57:38

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [PATCH v2 4/4] perf arm-spe: Remove redundant checking for "full_auxtrace"

Em Tue, May 25, 2021 at 03:03:53PM +0300, James Clark escreveu:
>
>
> On 19/05/2021 07:15, Leo Yan wrote:
> > The option "opts->full_auxtrace" is checked at the earlier place, if it
> > is false the function will directly bail out. So remove the redundant
> > checking for "opts->full_auxtrace".
> >
> > Suggested-by: James Clark <[email protected]>
> > Signed-off-by: Leo Yan <[email protected]>
> > ---
> > tools/perf/arch/arm64/util/arm-spe.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/perf/arch/arm64/util/arm-spe.c b/tools/perf/arch/arm64/util/arm-spe.c
> > index bacdf366040d..a4420d4df503 100644
> > --- a/tools/perf/arch/arm64/util/arm-spe.c
> > +++ b/tools/perf/arch/arm64/util/arm-spe.c
> > @@ -116,7 +116,7 @@ static int arm_spe_recording_options(struct auxtrace_record *itr,
> > return 0;
> >
> > /* We are in full trace mode but '-m,xyz' wasn't specified */
> > - if (opts->full_auxtrace && !opts->auxtrace_mmap_pages) {
> > + if (!opts->auxtrace_mmap_pages) {
> > if (privileged) {
> > opts->auxtrace_mmap_pages = MiB(4) / page_size;
> > } else {
> >
>
> Reviewed-by: James Clark <[email protected]>

Thanks, applied the series,

- Arnaldo