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]
Date:	Wed, 21 Jan 2015 15:00:15 -0700
From:	David Ahern <dsahern@...il.com>
To:	Victor Kamensky <victor.kamensky@...aro.org>,
	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Namhyung Kim <namhyung@...nel.org>
CC:	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Paul Mackerras <paulus@...ba.org>,
	Ingo Molnar <mingo@...hat.com>,
	Adrian Hunter <adrian.hunter@...el.com>,
	Jiri Olsa <jolsa@...hat.com>,
	Avi Kivity <avi@...udius-systems.com>,
	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
	Anton Blanchard <anton@...ba.org>,
	Will Deacon <will.deacon@....com>,
	Dave Martin <Dave.Martin@....com>,
	open list <linux-kernel@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	Jiri Olsa <jolsa@...nel.org>, Waiman Long <Waiman.Long@...com>
Subject: Re: [PATCH 2/2] perf symbols: debuglink should take symfs option
 into account

On 1/19/15 10:50 AM, Victor Kamensky wrote:
>> diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
>> index 45be944..6a2f663 100644
>> --- a/tools/perf/util/dso.c
>> +++ b/tools/perf/util/dso.c
>> @@ -42,19 +42,30 @@ int dso__read_binary_type_filename(const struct dso *dso,
>>          size_t len;
>>
>>          switch (type) {
>> -       case DSO_BINARY_TYPE__DEBUGLINK: {
>> +       case DSO_BINARY_TYPE__DEBUGLINK:
>> +       {
>>                  char *debuglink;
>> -
>> -               strncpy(filename, dso->long_name, size);
>> -               debuglink = filename + dso->long_name_len;
>> -               while (debuglink != filename && *debuglink != '/')
>> -                       debuglink--;
>> -               if (*debuglink == '/')
>> -                       debuglink++;
>> -               ret = filename__read_debuglink(dso->long_name, debuglink,
>> -                                              size - (debuglink - filename));
>> -               }
>> +               char *filename_copy;
>> +
>> +               filename_copy = malloc(PATH_MAX);
>> +               if (filename_copy) {
>> +                       len = __symbol__join_symfs(filename, size,
>> +                                                  dso->long_name);
>> +                       strncpy(filename_copy, filename, PATH_MAX);
>> +                       debuglink = filename + len;
>> +                       while (debuglink != filename && *debuglink != '/')
>> +                               debuglink--;
>> +                       if (*debuglink == '/')
>> +                               debuglink++;
>> +                       ret = filename__read_debuglink(filename_copy, debuglink,
>> +                                                      size - (debuglink -
>> +                                                              filename));
>> +                       free(filename_copy);
>> +               } else
>> +                       ret = -1;
>>                  break;
>> +       }
>> +

I do not believe the filename_copy is needed; just add the symfs path to 
filename and pass filename to read_debuglink

David

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ