Hey Vladimir,

Is it somehow possible to use tracemem() (or anything else which is able to
> print array of uchar_t's or string) to print stream of bytes in hexadecimal
> on single line ?
>
> I'd like to do something like this:
>
>        printf("0x");
>        tracemem(this->oinfo.xxx_id, 32);
>        printf("A:%-15s ... \n",
>            this->oinfo.xxx_raddr,
>            ...
>
> where xxx_id and xxx_raddr are of type string.
>
> I'd like the above to produce the output on single line:
>
> 0x7FFA403D13DF... A:...
>

There's nothing particularly convenient, but you could just print out your
array by hand: %02x%02x... To simplify it a little, you could cast it to a
uint64_t *:

  printf("%16x%16x", ((uint64_t *)this->oinfo.xxx_id)[0], ((uint64_t
*)this->oinfo.xxx_id)[1]);

I hope that helps.

Adam

-- 
Adam Leventhal, Delphix
http://dtrace.org/blogs/ahl

275 Middlefield Road, Suite 50
Menlo Park, CA 94025
http://www.delphix.com
_______________________________________________
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org

Reply via email to