hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/gpu/arm/bifrost/debug/mali_kbase_debug_ktrace.h
....@@ -1,7 +1,7 @@
11 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
22 /*
33 *
4
- * (C) COPYRIGHT 2020-2021 ARM Limited. All rights reserved.
4
+ * (C) COPYRIGHT 2020-2022 ARM Limited. All rights reserved.
55 *
66 * This program is free software and is provided to you under the terms of the
77 * GNU General Public License version 2 as published by the Free Software
....@@ -49,6 +49,7 @@
4949 /**
5050 * kbase_ktrace_init - initialize kbase ktrace.
5151 * @kbdev: kbase device
52
+ * Return: 0 if successful or a negative error code on failure.
5253 */
5354 int kbase_ktrace_init(struct kbase_device *kbdev);
5455
....@@ -81,6 +82,18 @@
8182 */
8283 #if KBASE_KTRACE_TARGET_RBUF
8384 /**
85
+ * kbasep_ktrace_initialized - Check whether kbase ktrace is initialized
86
+ *
87
+ * @ktrace: ktrace of kbase device.
88
+ *
89
+ * Return: true if ktrace has been initialized.
90
+ */
91
+static inline bool kbasep_ktrace_initialized(struct kbase_ktrace *ktrace)
92
+{
93
+ return ktrace->rbuf != NULL;
94
+}
95
+
96
+/**
8497 * kbasep_ktrace_add - internal function to add trace to the ringbuffer.
8598 * @kbdev: kbase device
8699 * @code: ktrace code