Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 71efb122 authored by Isaac J. Manjarres's avatar Isaac J. Manjarres
Browse files

trace: events: scm: Use correct size when copying argument buffer



When copying the SCM call arugment buffer for trace events,
the amount of bytes specified to copy is MAX_SCM_ARGS, which
is not correct, as this is only the maximum number of SCM
call arguments, but each argument is 8 bytes, and thus the
amount of bytes that should be copied is actually 80 bytes.

Since the size of the SCM call argument buffer is a compile
time constant, use sizeof() on the argument buffer to compute
the amount of bytes that should be copied.

Change-Id: Ib878006e60d5bf283ba8252498c651b3e3c99b28
Signed-off-by: default avatarIsaac J. Manjarres <isaacm@codeaurora.org>
parent a487c3ab
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
/* Copyright (c) 2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2016, 2018 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -35,7 +35,7 @@ TRACE_EVENT(scm_call_start,
	TP_fast_assign(
		__entry->x0		= x0;
		__entry->arginfo	= p->arginfo;
		memcpy(__entry->args, p->args, MAX_SCM_ARGS);
		memcpy(__entry->args, p->args, sizeof(__entry->args));
		__entry->x5		= p->x5;
	),

@@ -56,7 +56,7 @@ TRACE_EVENT(scm_call_end,
	),

	TP_fast_assign(
		memcpy(__entry->ret, p->ret, MAX_SCM_RETS);
		memcpy(__entry->ret, p->ret, sizeof(__entry->ret));
	),

	TP_printk("ret: %#llx, %#llx, %#llx",