linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] trace-cruncher: Use proper naming in common.h
@ 2021-08-17 16:41 Yordan Karadzhov (VMware)
  2021-08-17 16:41 ` [PATCH 2/4] trace-cruncher: Add type checking for the custom Python types Yordan Karadzhov (VMware)
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yordan Karadzhov (VMware) @ 2021-08-17 16:41 UTC (permalink / raw)
  To: linux-trace-devel; +Cc: Yordan Karadzhov (VMware)

PyTepEvent was the first Python type defined in the C extension module.
A legacy from this first implementation can be found in the naming of
some variables used by the type definition macros.

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 src/common.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/common.h b/src/common.h
index 9985328..6046c0f 100644
--- a/src/common.h
+++ b/src/common.h
@@ -54,27 +54,27 @@ static inline void no_free()
 
 #define STR(x) #x
 
-#define MAKE_TYPE_STR(x) STR(traceevent.x)
+#define MAKE_TYPE_STR(x) STR(trace.x)
 
-#define MAKE_DIC_STR(x) STR(libtraceevent x object)
+#define MAKE_DIC_STR(x) STR(libtrace x object)
 
 #define C_OBJECT_WRAPPER_DECLARE(c_type, py_type)				\
 	typedef struct {							\
 	PyObject_HEAD								\
 	struct c_type *ptrObj;							\
 } py_type;									\
-PyObject *py_type##_New(struct c_type *evt_ptr);				\
+PyObject *py_type##_New(struct c_type *c_ptr);					\
 bool py_type##TypeInit();							\
 
 #define  C_OBJECT_WRAPPER(c_type, py_type, ptr_free)				\
 static PyTypeObject py_type##Type = {						\
 	PyVarObject_HEAD_INIT(NULL, 0) MAKE_TYPE_STR(c_type)			\
 };										\
-PyObject *py_type##_New(struct c_type *evt_ptr)					\
+PyObject *py_type##_New(struct c_type *c_ptr)					\
 {										\
 	py_type *newObject;							\
 	newObject = PyObject_New(py_type, &py_type##Type);			\
-	newObject->ptrObj = evt_ptr;						\
+	newObject->ptrObj = c_ptr;						\
 	return (PyObject *) newObject;						\
 }										\
 static int py_type##_init(py_type *self, PyObject *args, PyObject *kwargs)	\
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-17 16:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-17 16:41 [PATCH 1/4] trace-cruncher: Use proper naming in common.h Yordan Karadzhov (VMware)
2021-08-17 16:41 ` [PATCH 2/4] trace-cruncher: Add type checking for the custom Python types Yordan Karadzhov (VMware)
2021-08-17 16:41 ` [PATCH 3/4] trace-cruncher: Define Python type for instances Yordan Karadzhov (VMware)
2021-08-17 16:41 ` [PATCH 4/4] trace-cruncher: Refactor the way libtracefs instances are handled Yordan Karadzhov (VMware)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).