uint64_t get_cpu_id(const struct bt_ctf_event *event)
{
- const struct definition *scope;
+ const struct bt_definition *scope;
uint64_t cpu_id;
scope = bt_ctf_get_top_level_scope(event, BT_STREAM_PACKET_CONTEXT);
uint64_t get_context_tid(const struct bt_ctf_event *event)
{
- const struct definition *scope;
+ const struct bt_definition *scope;
uint64_t tid;
scope = bt_ctf_get_top_level_scope(event, BT_STREAM_EVENT_CONTEXT);
uint64_t get_context_pid(const struct bt_ctf_event *event)
{
- const struct definition *scope;
+ const struct bt_definition *scope;
uint64_t pid;
scope = bt_ctf_get_top_level_scope(event, BT_STREAM_EVENT_CONTEXT);
uint64_t get_context_ppid(const struct bt_ctf_event *event)
{
- const struct definition *scope;
+ const struct bt_definition *scope;
uint64_t ppid;
scope = bt_ctf_get_top_level_scope(event, BT_STREAM_EVENT_CONTEXT);
char *get_context_comm(const struct bt_ctf_event *event)
{
- const struct definition *scope;
+ const struct bt_definition *scope;
char *comm;
scope = bt_ctf_get_top_level_scope(event, BT_STREAM_EVENT_CONTEXT);
enum bt_cb_ret handle_statedump_process_state(struct bt_ctf_event *call_data,
void *private_data)
{
- const struct definition *scope;
+ const struct bt_definition *scope;
struct processtop *proc;
unsigned long timestamp;
int64_t pid, tid;
error:
return BT_CB_ERROR_STOP;
}
+
+struct tm format_timestamp(uint64_t timestamp)
+{
+ struct tm tm;
+ uint64_t ts_sec = 0, ts_nsec;
+ time_t time_s;
+
+ ts_nsec = timestamp;
+ ts_sec += ts_nsec / NSEC_PER_SEC;
+ ts_nsec = ts_nsec % NSEC_PER_SEC;
+
+ time_s = (time_t) ts_sec;
+
+ localtime_r(&time_s, &tm);
+
+ return tm;
+}