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:	Tue, 12 Jul 2011 16:01:11 -0700
From:	Sonny Rao <sonnyrao@...omium.org>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	acme@...hat.com, anton@...ba.org,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Paul Mackerras <paulus@...ba.org>, Ingo Molnar <mingo@...e.hu>,
	Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] [RFC] perf: robustify proc and debugfs file recording

On Tue, Jul 12, 2011 at 3:56 PM, Steven Rostedt <rostedt@...dmis.org> wrote:
> On Tue, 2011-07-12 at 14:15 -0700, Sonny Rao wrote:
>> While attempting to create a timechart of boot up I found
>> perf didn't tolerate modules being loaded/unloaded.  This patch
>> fixes this by reading the file once and then writing the size
>> read at the correct point in the file.  It also simplifies the
>> code somewhat.
>>
>> Signed-off-by: Sonny Rao <sonnyrao@...omium.org>
>
>>  static bool name_in_tp_list(char *sys, struct tracepoint_path *tps)
>> @@ -338,14 +292,8 @@ static void copy_event_system(const char *sys, struct tracepoint_path *tps)
>>               sprintf(format, "%s/%s/format", sys, dent->d_name);
>>               ret = stat(format, &st);
>>
>> -             if (ret >= 0) {
>> -                     /* unfortunately, you can not stat debugfs files for size */
>> -                     size = get_size(format);
>> -                     write_or_die(&size, 8);
>> -                     check_size = copy_file(format);
>> -                     if (size != check_size)
>> -                             die("error in size of file '%s'", format);
>
> You mean to tell me that you are hitting a race between the get_size()
> and check_size()?  This is a very quick action, and this only happens at
> start up. Are you starting up perf and loading modules at the same time?

I sure am... the thing we're trying to do here is analyze our boot time
and udev is asynchronously loading modules in the background while
perf is starting up.

We've put in stupid hacks like sleep for a while, but they've proven to be
unreliable so I figured I'd take a stab at fixing the issue.  I also think this
change will make the overhead a bit lower since we only read these files
once.

Sonny
--
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