This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH] arm64: use sregs for syscall probe registers
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: Frank van der Linden <fllinden at amazon dot com>
- Cc: <systemtap at sourceware dot org>
- Date: Tue, 16 Apr 2019 11:33:20 -0400
- Subject: Re: [PATCH] arm64: use sregs for syscall probe registers
- References: <5cb0cb1f.ROdjA4uUKaH5hT/r%fllinden@amazon.com>
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