security: Add tracing for SecureOS measurements
Add new tracepoint events for SecureOS-related tracing.
The timestamp traces measure the number of cycles taken
to switch between normal world and secure world using the
CP15 cycle counter.
Bug 1042455
Change-Id: Ia7f0718a0fcc399875a175670b80dfe33f79b95e
Signed-off-by: Charles Tan <ctan@nvidia.com>
Reviewed-on: http://git-master/r/159367
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Antti Miettinen <amiettinen@nvidia.com>
Tested-by: Antti Miettinen <amiettinen@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
diff --git a/security/tf_driver/tf_device.c b/security/tf_driver/tf_device.c
index 1bdf5ac..51dbb37 100644
--- a/security/tf_driver/tf_device.c
+++ b/security/tf_driver/tf_device.c
@@ -2,6 +2,8 @@
* Copyright (c) 2011 Trusted Logic S.A.
* All Rights Reserved.
*
+ * Copyright (C) 2011-2012 NVIDIA Corporation.
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
@@ -46,6 +48,9 @@
#include "s_version.h"
+#define CREATE_TRACE_POINTS
+#include <trace/events/nvsecurity.h>
+
/*----------------------------------------------------------------------------
* Forward Declarations
*----------------------------------------------------------------------------*/
@@ -733,8 +738,10 @@
break;
case TF_MESSAGE_TYPE_INVOKE_CLIENT_COMMAND:
+ trace_invoke_client_command(NVSEC_INVOKE_CMD_START);
result = tf_invoke_client_command(connection,
&command, &answer);
+ trace_invoke_client_command(NVSEC_INVOKE_CMD_DONE);
break;
case TF_MESSAGE_TYPE_CANCEL_CLIENT_COMMAND: