Message ID | 1455300361-13092-18-git-send-email-konrad.wilk@oracle.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 12/02/16 18:05, Konrad Rzeszutek Wilk wrote: > Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> > --- > xen/common/xsplice.c | 36 ++++++++++++++++++++++++++++-------- > 1 file changed, 28 insertions(+), 8 deletions(-) > > diff --git a/xen/common/xsplice.c b/xen/common/xsplice.c > index 2ba5bb5..8c5557e 100644 > --- a/xen/common/xsplice.c > +++ b/xen/common/xsplice.c > @@ -101,6 +101,21 @@ static const char *state2str(int32_t state) > return names[state]; > } > > +static void xsplice_print_build_id(char *id, unsigned int len) > +{ > + unsigned int i; > + > + if ( !len ) > + return; > + > + for ( i = 0; i < len; i++ ) > + { > + uint8_t c = id[i]; > + printk("%02x", c); What about the already existing %*ph custom format? If the spaces are a problem we could introduce %*phN from Linux which has no spaces. The advantage of this is that it is a single call to printk, rather than many, and avoids the ability for a different cpu to interleave in the middle of a line. ~Andrew
>>> On 16.02.16 at 21:20, <andrew.cooper3@citrix.com> wrote: > On 12/02/16 18:05, Konrad Rzeszutek Wilk wrote: >> +static void xsplice_print_build_id(char *id, unsigned int len) >> +{ >> + unsigned int i; >> + >> + if ( !len ) >> + return; >> + >> + for ( i = 0; i < len; i++ ) >> + { >> + uint8_t c = id[i]; >> + printk("%02x", c); > > What about the already existing %*ph custom format? If the spaces are a > problem we could introduce %*phN from Linux which has no spaces. > > The advantage of this is that it is a single call to printk, rather than > many, and avoids the ability for a different cpu to interleave in the > middle of a line. I don't think this ability exists anymore after we've switched to per-CPU there. Which isn't to say, though, that I wouldn't also like to see this be just a single printk(). Jan
diff --git a/xen/common/xsplice.c b/xen/common/xsplice.c index 2ba5bb5..8c5557e 100644 --- a/xen/common/xsplice.c +++ b/xen/common/xsplice.c @@ -101,6 +101,21 @@ static const char *state2str(int32_t state) return names[state]; } +static void xsplice_print_build_id(char *id, unsigned int len) +{ + unsigned int i; + + if ( !len ) + return; + + for ( i = 0; i < len; i++ ) + { + uint8_t c = id[i]; + printk("%02x", c); + } + printk("\n"); +} + static void xsplice_printall(unsigned char key) { struct payload *data; @@ -111,14 +126,9 @@ static void xsplice_printall(unsigned char key) rc = xen_build_id(&binary_id, &len); printk("build-id: "); if ( !rc ) - { - for ( i = 0; i < len; i++ ) - { - uint8_t c = binary_id[i]; - printk("%02x", c); - } - printk("\n"); - } else if ( rc < 0 ) + xsplice_print_build_id(binary_id, len); + + else if ( rc < 0 ) printk("rc = %d\n", rc); spin_lock(&payload_lock); @@ -135,6 +145,16 @@ static void xsplice_printall(unsigned char key) printk(" %s patch 0x%"PRIx64"(%u) with 0x%"PRIx64"(%u)\n", f->name, f->old_addr, f->old_size, f->new_addr, f->new_size); } + if ( data->id.len ) + { + printk(" build_id="); + xsplice_print_build_id(data->id.p, data->id.len); + } + if ( data->dep.len ) + { + printk(" depend on="); + xsplice_print_build_id(data->dep.p, data->dep.len); + } } spin_unlock(&payload_lock); }
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> --- xen/common/xsplice.c | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-)