050268f67fd97af9ba4eadbaab6055dbc3a09875
6 * Copyright 2012 EfficiOS Inc. and Linux Foundation
8 * Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 * Julien Desfossez <julien.desfossez@efficios.com>
11 * Permission is hereby granted, free of charge, to any person obtaining a copy
12 * of this software and associated documentation files (the "Software"), to deal
13 * in the Software without restriction, including without limitation the rights
14 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 * copies of the Software, and to permit persons to whom the Software is
16 * furnished to do so, subject to the following conditions:
18 * The above copyright notice and this permission notice shall be included in
19 * all copies or substantial portions of the Software.
24 #include <babeltrace/babeltrace.h>
25 #include <babeltrace/context.h>
26 #include <babeltrace/context-internal.h>
27 #include <babeltrace/trace-handle.h>
28 #include <babeltrace/trace-handle-internal.h>
30 struct bt_trace_handle
*bt_trace_handle_create(struct bt_context
*ctx
)
32 struct bt_trace_handle
*th
;
34 th
= g_new0(struct bt_trace_handle
, 1);
35 th
->id
= ctx
->last_trace_handle_id
++;
39 void bt_trace_handle_destroy(struct bt_trace_handle
*th
)
44 int bt_trace_handle_get_id(struct bt_trace_handle
*th
)
49 const char *bt_trace_handle_get_path(struct bt_context
*ctx
, int handle_id
)
51 struct bt_trace_handle
*handle
;
53 handle
= g_hash_table_lookup(ctx
->trace_handles
,
54 (gpointer
) (unsigned long) handle_id
);
60 uint64_t bt_trace_handle_get_timestamp_begin(struct bt_context
*ctx
, int handle_id
)
62 struct bt_trace_handle
*handle
;
64 handle
= g_hash_table_lookup(ctx
->trace_handles
,
65 (gpointer
) (unsigned long) handle_id
);
68 return handle
->timestamp_begin
;
71 uint64_t bt_trace_handle_get_timestamp_end(struct bt_context
*ctx
, int handle_id
)
73 struct bt_trace_handle
*handle
;
75 handle
= g_hash_table_lookup(ctx
->trace_handles
,
76 (gpointer
) (unsigned long) handle_id
);
79 return handle
->timestamp_end
;
This page took 0.032901 seconds and 3 git commands to generate.