[PATCH 4/4] libtracefs: Have synthetic events use types pid_t, gfp_t and bool

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx>

The synthetic events understand pid_t, gfp_t and bool, and it is better to
use them, as some kernels have bugs where a field with one of the above
types may not match the raw format they are.

That is, pid_t may not match s32, even though they are the same type!

Fixes: 7c9000c7495b9 ("libtracefs: Create a way to create a synthetic event")
Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>
---
 src/tracefs-hist.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/tracefs-hist.c b/src/tracefs-hist.c
index ec63b88a0bca..e7dd279ae3f9 100644
--- a/src/tracefs-hist.c
+++ b/src/tracefs-hist.c
@@ -841,6 +841,15 @@ static char *add_synth_field(const struct tep_format_field *field,
 		return append_string(str, NULL, "];");
 	}
 
+	/* Synthetic events understand pid_t, gfp_t and bool */
+	if (strcmp(field->type, "pid_t") == 0 ||
+	    strcmp(field->type, "gfp_t") == 0 ||
+	    strcmp(field->type, "bool") == 0) {
+		str = strdup(field->type);
+		str = append_string(str, " ", name);
+		return append_string(str, NULL, ";");
+	}
+
 	sign = field->flags & TEP_FIELD_IS_SIGNED;
 
 	switch (field->size) {
-- 
2.33.0




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux