Home | History | Annotate | Download | only in libop
      1 /**
      2  * @file op_mangle.h
      3  * Mangling of sample file names
      4  *
      5  * @remark Copyright 2002 OProfile authors
      6  * @remark Read the file COPYING
      7  *
      8  * @author John Levon
      9  * @author Philippe Elie
     10  */
     11 
     12 #ifndef OP_MANGLE_H
     13 #define OP_MANGLE_H
     14 
     15 #include <sys/types.h>
     16 
     17 #ifdef __cplusplus
     18 extern "C" {
     19 #endif
     20 
     21 enum mangle_flags {
     22 	MANGLE_NONE      = 0,
     23 	MANGLE_CPU       = (1 << 0),
     24 	MANGLE_TGID      = (1 << 1),
     25 	MANGLE_TID       = (1 << 2),
     26 	MANGLE_KERNEL    = (1 << 3),
     27 	MANGLE_CALLGRAPH = (1 << 4),
     28 	MANGLE_ANON      = (1 << 5),
     29 	MANGLE_CG_ANON   = (1 << 6),
     30 };
     31 
     32 /**
     33  * Temporary structure for passing parameters to
     34  * op_mangle_filename.
     35  */
     36 struct mangle_values {
     37 	int flags;
     38 
     39 	char const * image_name;
     40 	char const * anon_name;
     41 	char const * dep_name;
     42 	char const * cg_image_name;
     43 	char const * event_name;
     44 	int count;
     45 	unsigned int unit_mask;
     46 	pid_t tgid;
     47 	pid_t tid;
     48 	int cpu;
     49 };
     50 
     51 /**
     52  * op_mangle_filename - mangle a sample filename
     53  * @param values  parameters to use as mangling input
     54  *
     55  * See also PP:3 for the encoding scheme
     56  *
     57  * Returns a char* pointer to the mangled string. Caller
     58  * is responsible for freeing this string.
     59  */
     60 char * op_mangle_filename(struct mangle_values const * values);
     61 
     62 #ifdef __cplusplus
     63 }
     64 #endif
     65 
     66 #endif /* OP_MANGLE_H */
     67