[Crash-utility] [PATCH] Extend the SIAL built-in functions to include memset function.
Aravinda Prasad
aravinda at linux.vnet.ibm.com
Wed Apr 18 10:49:22 UTC 2012
On Tuesday 17 April 2012 12:57 AM, Luc Chouinard wrote:
>
> Aravinda, can you use the sial_builtin() API call to install that function from your application?
> It seems like this is a particular use case for makedumpfile only.
>
> You should be able to do this like sial.c does it for the curtask() builtin.
Thanks Luc. Using sial_builtin() API call to install a new function is
simple and easy. I will use it.
Regards,
Aravinda
>
>
> -Luc
>
> -----Original Message-----
> From: Dave Anderson [mailto:anderson at redhat.com]
> Sent: Mon 4/16/2012 2:26 PM
> To: Aravinda Prasad
> Cc: tachibana at mxm.nes.nec.co.jp; kumagai-atsushi at mxc.nes.nec.co.jp; ananth at in.ibm.com; buendgen at de.ibm.com; Luc Chouinard; crash-utility at redhat.com
> Subject: Re: [PATCH] Extend the SIAL built-in functions to include memset function.
>
>
>
> ----- Original Message -----
>> The memset function will be used to specify the virtual address
>> and the length of the data to be scrubbed in the dump file when
>> the SIAL macro is used with the makedumpfile command. The
>> makedumpfile command is currently being enhanced to accept SIAL
>> macros to scrub data in the dump file.
>>
>> When used with crash, SIAL macro using memset function will
>> have no effect (as intended as dump file should not be modified).
>> This is because the API_PUTMEM call back function implemented
>> in crash extension layer is a no-op.
>
> OK, but then I don't understand the point of adding this to the
> crash utility's version of libsial?
>
> Dave
>
>>
>> Signed-off-by: Aravinda Prasad<aravinda at linux.vnet.ibm.com>
>> ---
>> extensions/libsial/sial_builtin.c | 13 +++++++++++++
>> 1 files changed, 13 insertions(+), 0 deletions(-)
>>
>> diff --git a/extensions/libsial/sial_builtin.c
>> b/extensions/libsial/sial_builtin.c
>> index e189f5e..05228a4 100644
>> --- a/extensions/libsial/sial_builtin.c
>> +++ b/extensions/libsial/sial_builtin.c
>> @@ -192,6 +192,18 @@ char p[1024];
>> return sial_setstrval(sial_newval(), p);
>> }
>>
>> +value_t *
>> +sial_memset(value_t* vaddr, value_t* vch, value_t* vlen)
>> +{
>> +ull addr=sial_getval(vaddr);
>> +int len=sial_getval(vlen);
>> +ull ch=sial_getval(vch);
>> +
>> + API_PUTMEM(addr, (void *)ch, len);
>> + return sial_makebtype(1);
>> +}
>> +
>> +
>> static builtin *bfuncs=0;
>>
>> /*
>> @@ -334,6 +346,7 @@ static btspec_t sialbfuncs[] = {
>> { "void prarr(string name, int i)", bcast(sial_prarr)},
>> { "int member(void*, string name)", bcast(sial_ismember)},
>> { "string findsym(string)", bcast(sial_findsym)},
>> + { "int memset(char*, int, int)", bcast(sial_memset)},
>> };
>>
>>
>>
>>
>
More information about the Crash-utility
mailing list