On Monday 16 April 2012 11:56 PM, Dave Anderson wrote:
----- 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?
If I am not wrong, the plan is to use the same version of libsial for
both crash and makedumpfile once a new project is created for SIAL. As
it is not yet created, I thought of mailing the patch to crash mailing
list, which would be included in SIAL once the project is created.
However, this patch is not required any more as the functionality can
be achieved by extending the built-in functions using sial_builtin().
Regards,
Aravinda
Dave
>
> Signed-off-by: Aravinda Prasad<aravinda(a)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)},
> };
>
>
>
>