[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
>>> Konrad Rzeszutek Wilk <konrad@xxxxxxxxxx> 04/06/16 4:39 AM >>> >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; >> > - >> > + 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. How does one being on the stack and the other in (I assume) a string table prevent their pointers to be compared? Iirc for the in-hypervisor symbols symbols_lookup() simply returns the passed in namebuf, and hence s == namebuf above. Or I must be missing something... Jan _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |