2 * @file daemon/opd_trans.h
3 * Processing the sample buffer
5 * @remark Copyright 2002 OProfile authors
6 * @remark Read the file COPYING
9 * @author Philippe Elie
11 * Modified by Maynard Johnson <maynardj@us.ibm.com>
12 * These modifications are:
13 * (C) Copyright IBM Corporation 2007
19 #include "opd_cookie.h"
34 * Transient values used for parsing the event buffer.
35 * Note that these are reset for each buffer read, but
36 * that should be ok as in the kernel, cpu_buffer_reset()
37 * ensures that a correct context starts off the buffer.
42 enum tracing_type tracing;
43 struct sfile * current;
45 struct anon_mapping * anon;
46 struct anon_mapping * last_anon;
56 uint64_t embedded_offset;
60 typedef void (*handler_t)(struct transient *);
61 extern handler_t handlers[];
63 uint64_t pop_buffer_value(struct transient * trans);
64 int enough_remaining(struct transient * trans, size_t size);
65 static inline void update_trans_last(struct transient * trans)
67 trans->last = trans->current;
68 trans->last_anon = trans->anon;
69 trans->last_pc = trans->pc;
72 extern size_t kernel_pointer_size;
73 static inline int is_escape_code(uint64_t code)
75 return kernel_pointer_size == 4 ? code == ~0LU : code == ~0LLU;
78 void opd_process_samples(char const * buffer, size_t count);
80 /** used when we need to clear data that's been freed */
81 void clear_trans_last(struct transient * trans);
83 /** used when we need to clear data that's been freed */
84 void clear_trans_current(struct transient * trans);
86 #endif /* OPD_TRANS_H */