[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v5 14/28] x86, xsplice: Print payload's symbol name and payload name in backtraces



On Fri, Apr 01, 2016 at 09:23:15AM -0600, Jan Beulich wrote:
> >>> On 24.03.16 at 21:00, <konrad.wilk@xxxxxxxxxx> wrote:
> > @@ -331,16 +332,17 @@ static char *pointer(char *str, char *end, const char 
> > **fmt_ptr,
> >      {
> >          unsigned long sym_size, sym_offset;
> >          char namebuf[KSYM_NAME_LEN+1];
> > +        bool_t payload = 0;
> >  
> >          /* Advance parents fmt string, as we have consumed 's' or 'S' */
> >          ++*fmt_ptr;
> >  
> >          s = symbols_lookup((unsigned long)arg, &sym_size, &sym_offset, 
> > namebuf);
> > -
> > -        /* If the symbol is not found, fall back to printing the address */
> > +        /* If the symbol is not found, fall back to printing the address. 
> > */
> >          if ( !s )
> >              break;
> > -
> 
> Please don't drop blank lines like this.
> 
> > +        if ( strncmp(namebuf, s, KSYM_NAME_LEN) )
> > +            payload = 1;
> 
> What is this about? A comment is absolutely needed here, the
> more that without context "payload" is also an unclear term.
> And then - would simply comparing the two pointers suffice?

Sadly no. The namebuf is defined on the stack (and the value copied in)
while the 's' is a pointer to the char* in the symbols.

For all Xen hypervisor built-in symbols the 'namebuf' contents and 's'
are exactly the same. The only difference is when xSplice comes in
and the 'namebuf' has the name of the xSplice payload.

I will put a comment here.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.