Skip to contentSkip to conversation

tools/lib/traceevent: Initialize host_bigendian at tep_handle allocation

PATCH New Tzvetomir Stoyanov 1 participant 1 message Nov 10, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/lib/traceevent: Initialize host_bigendian at tep_handle allocation

This patch initializes host_bigendian member of the tep_handle structure with the byte order of current host, when this handler is created - in tep_alloc() API. We need this in order to remove tep_set_host_bigendian() API.

---
 tools/lib/traceevent/event-parse.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/lib/traceevent/event-parse.c +3 -1
index 9147099d27e5..3156a52ddbbd 100644
@@ -6805,8 +6805,10 @@ struct tep_handle *tep_alloc(void)
 {
 	struct tep_handle *pevent = calloc(1, sizeof(*pevent));
 
-	if (pevent)
+	if (pevent) {
 		pevent->ref_count = 1;
+		pevent->host_bigendian = tep_host_bigendian();
+	}
 
 	return pevent;
 }
Signature · 1 line
2.17.2