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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171024072615.GC27972@krava>
Date:   Tue, 24 Oct 2017 09:26:15 +0200
From:   Jiri Olsa <jolsa@...hat.com>
To:     "Liang, Kan" <kan.liang@...el.com>
Cc:     "acme@...nel.org" <acme@...nel.org>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "jolsa@...nel.org" <jolsa@...nel.org>,
        "wangnan0@...wei.com" <wangnan0@...wei.com>,
        "hekuang@...wei.com" <hekuang@...wei.com>,
        "namhyung@...nel.org" <namhyung@...nel.org>,
        "alexander.shishkin@...ux.intel.com" 
        <alexander.shishkin@...ux.intel.com>,
        "Hunter, Adrian" <adrian.hunter@...el.com>,
        "ak@...ux.intel.com" <ak@...ux.intel.com>
Subject: Re: [PATCH V3 4/6] perf tools: add perf_data_file__open_tmp

On Mon, Oct 23, 2017 at 06:05:12PM +0000, Liang, Kan wrote:
> > SNIP
> > 
> > > > >  ssize_t perf_data_file__write(struct perf_data_file *file, diff
> > > > > --git a/tools/perf/util/data.h b/tools/perf/util/data.h index
> > > > > ae510ce..892b3d5 100644
> > > > > --- a/tools/perf/util/data.h
> > > > > +++ b/tools/perf/util/data.h
> > > > > @@ -10,6 +10,7 @@ enum perf_data_mode {
> > > > >
> > > > >  struct perf_data_file {
> > > > >  	const char		*path;
> > > > > +	char			*tmp_path;
> > > >
> > > > could we add is_tmp instead of new path pointer and keep the path
> > > > for the name..?
> > >
> > > The 'path' is const char. I think it's not good for tmp file which
> > > generate the file name in real time.
> > 
> > then change path to 'char *' ? I just dont think having
> > 2 name pointers for path will keep this simple
> >
> 
> I tried, but it will impact almost all the perf tools.
> The input/output file name is const char*, which means that the file
> name should not be change.
> I just don't think it's right to cast it to char *.

ok, then the original approach does not look that bad now ;-)

jirka

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ