lkml.org 
[lkml]   [2010]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv9 2.6.35-rc4-tip 10/13] perf: Re-Add make_absolute_path
Em Mon, Jul 12, 2010 at 10:30:36AM -0400, Steven Rostedt escreveu:
> On Mon, 2010-07-12 at 11:00 -0300, Arnaldo Carvalho de Melo wrote:
> > Also please remove the xstrdup and die calls from this function, we're
> > trying to get rid of all such 'panic' like functions so that we can
> > librarize as much code as possible.

> What I found useful with the "die" calls with trace-cmd is that I made
> them weak, and then they could be overwritten by apps. Thus, in
> kernelshark, the die and warning functions produce pop-ups and bug
> reports.

Well, I prefer to follow the kernel way of doing things, i.e. to
propagate as much as possible up the callchain the error return value,
so that the apps can handle it in any way they prefer, i.e. die() calls
in tools/perf/builtin-foo.c are okayish, but not on tools/perf/util/.

When I'm writing a tools/perf/builtin-.c file I also don't use die()
calls, as some routines may end up moving to the library, so its nice to
avoid them from the start.

The pr_{warning,err,info,etc} calls do something along the lines of what
you do, but not by marking them weak, the routine that is ultimately
called checks what kind of UI is being used and calls the appropriate
one (TUI/NEWT of stdio).

- Arnaldo


\
 
 \ /
  Last update: 2010-07-12 18:15    [W:0.194 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site