lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YVMVwDt3QHBPfT/T@kernel.org>
Date:   Tue, 28 Sep 2021 10:16:48 -0300
From:   Arnaldo Carvalho de Melo <acme@...nel.org>
To:     John Garry <john.garry@...wei.com>
Cc:     Like Xu <like.xu.linux@...il.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf jevents: Fix sys_event_tables to be freed like
 arch_std_events

Em Tue, Sep 28, 2021 at 01:49:20PM +0100, John Garry escreveu:
> On 28/09/2021 12:52, Arnaldo Carvalho de Melo wrote:
> > Em Tue, Sep 28, 2021 at 06:29:38PM +0800, Like Xu escreveu:
> > > From: Like Xu <likexu@...cent.com>
> > > 
> > > The compiler reports that free_sys_event_tables() is dead code. But
> > > according to the semantics, the "LIST_HEAD(arch_std_events)" should
> > > also be released, just like we do with 'arch_std_events' in the main().
> > 
> > Thanks, applied.
> > 
> > - Arnaldo
> > 
> 
> If not too late:
> Reviewed-by: John Garry <john.garry@...wei.com>

Not too late, collected.
 
> I think that it could be a good idea to raise gcc warning level to detect
> unused static functions, like this was

Agreed, but we already have:

CORE_CFLAGS += -Wall
CORE_CFLAGS += -Wextra

We can se it for this specific case with:

$ make V=1 -k BUILD_BPF_SKEL=1 CORESIGHT=1 PYTHON=python3 O=/tmp/build/perf -C tools/perf install-bin | grep jevents
make -f /var/home/acme/git/perf/tools/build/Makefile.build dir=pmu-events obj=jevents
  gcc -Wp,-MD,/tmp/build/perf/pmu-events/.jevents.o.d -Wp,-MT,/tmp/build/perf/pmu-events/jevents.o  -D"BUILD_STR(s)=#s" -I/var/home/acme/git/perf/tools/include  -c -o /tmp/build/perf/pmu-events/jevents.o pmu-events/jevents.c
   ld -r -o /tmp/build/perf/pmu-events/jevents-in.o  /tmp/build/perf/pmu-events/json.o /tmp/build/perf/pmu-events/jsmn.o /tmp/build/perf/pmu-events/jevents.o
gcc /tmp/build/perf/pmu-events/jevents-in.o -o /tmp/build/perf/pmu-events/jevents
/tmp/build/perf/pmu-events/jevents x86 pmu-events/arch /tmp/build/perf/pmu-events/pmu-events.c 1
jevents: Processing mapfile pmu-events/arch/x86/mapfile.csv

Humm... no "-Wall -Wextra" there... lemme try to fix it

- Arnaldo
 
> thanks
> 
> > > Fixes: e9d32c1bf0cd7a98 ("perf vendor events: Add support for arch standard events")
> > > Signed-off-by: Like Xu <likexu@...cent.com>
> > > ---
> > >   tools/perf/pmu-events/jevents.c | 2 ++
> > >   1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c
> > > index 6731b3cf0c2f..7c887d37b893 100644
> > > --- a/tools/perf/pmu-events/jevents.c
> > > +++ b/tools/perf/pmu-events/jevents.c
> > > @@ -1285,6 +1285,7 @@ int main(int argc, char *argv[])
> > >   	}
> > >   	free_arch_std_events();
> > > +	free_sys_event_tables();
> > >   	free(mapfile);
> > >   	return 0;
> > > @@ -1306,6 +1307,7 @@ int main(int argc, char *argv[])
> > >   		create_empty_mapping(output_file);
> > >   err_out:
> > >   	free_arch_std_events();
> > > +	free_sys_event_tables();
> > >   	free(mapfile);
> > >   	return ret;
> > >   }
> > > -- 
> > > 2.32.0
> > 

-- 

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ