This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] arm64: use sregs for syscall probe registers


Frank van der Linden <fllinden@amazon.com> writes:

> Since syscall wrappers are now active on arm64 (4.19+), arguments need to
> be retrieved the right way, by checking if there is a saved set of system
> call registers, and using them if there are.  [...]

This looks good to me.


> +	if (STAP_ARG_argnum < 1 || STAP_ARG_argnum > 8) {
> +		snprintf(CONTEXT->error_buffer, sizeof(CONTEXT->error_buffer),
> +				"Cannot access arg(%lld)",
> +				(long long)STAP_ARG_argnum);
> +		CONTEXT->last_error = CONTEXT->error_buffer;
> +		return;
> +	}

By the way, as listed in [man stap], there are some helper macros to
make this a little more compact:

        if (...) { 
            STAP_ERROR("foo bar %lld", (long long)foo);
        }

- FChE


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]