Mehul Choube

2011-11-08 11:48:17 UTC

Permalink

Raw Message

I want the guid in a variable. I tried stringof(), strjoin(), copyinstr() but none works :(

D script:

=======

#!/usr/sbin/dtrace -s

#pragma D option quiet

typedef struct GUID {

unsigned long Data1;

unsigned long Data2;

unsigned long Data3;

unsigned char Data4[8];

}GUID_t;

pid$1::*myFunc*:entry

{

this->ptr = arg1;

this->sptr = (GUID_t *)copyin(this->ptr, sizeof(GUID_t));

printf("Id: ");

printf("%8.8X%4.4X%4.4X%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X\\n",

((GUID_t *)this->sptr)->Data1, ((GUID_t *)this->sptr)->Data2, ((GUID_t *)this->sptr)->Data3,

((GUID_t *)this->sptr)->Data4[0], ((GUID_t *)this->sptr)->Data4[1], ((GUID_t *)this->sptr)->Data4[2],

((GUID_t *)this->sptr)->Data4[3], ((GUID_t *)this->sptr)->Data4[4], ((GUID_t *)this->sptr)->Data4[5],

((GUID_t *)this->sptr)->Data4[6], ((GUID_t *)this->sptr)->Data4[7]);

}

=======

The output is:

Id: 11E109F8702B323E9CAF5000568000D000000000

Any help is greatly appreciated.

Thanks,

Mehul