e5d9a4240dc9e438ab47f6ffae96c6332e2b82bc
1 #ifndef _BABELTRACE_CONTEXT_H
2 #define _BABELTRACE_CONTEXT_H
9 * Copyright 2012 EfficiOS Inc. and Linux Foundation
11 * Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
12 * Julien Desfossez <julien.desfossez@efficios.com>
14 * Permission is hereby granted, free of charge, to any person obtaining
15 * a copy of this software and associated documentation files (the
16 * "Software"), to deal in the Software without restriction, including
17 * without limitation the rights to use, copy, modify, merge, publish,
18 * distribute, sublicense, and/or sell copies of the Software, and to
19 * permit persons to whom the Software is furnished to do so, subject to
20 * the following conditions:
22 * The above copyright notice and this permission notice shall be
23 * included in all copies or substantial portions of the Software.
26 /* struct bt_context is opaque to the user */
30 * bt_context_create : create a Babeltrace context
32 * Allocate a new context. The creation of the context sets the refcount
35 * Returns an allocated context on success and NULL on error
37 struct bt_context
*bt_context_create(void);
40 * bt_context_add_trace : Add a trace by path to the context
44 * Return the trace handle id of the opened trace
46 int bt_context_add_trace(struct bt_context
*ctx
, const char *path
,
50 * bt_context_add_traces: Open a trace recursively
52 * Find each trace present in the subdirectory starting from the given
53 * path, and add them to the context.
55 * Return: 0 on success, nonzero on failure.
57 int bt_context_add_traces(struct bt_context
*ctx
, const char *path
,
61 * bt_context_remove_trace: Remove a trace from the context.
63 * Effectively closing the trace.
65 void bt_context_remove_trace(struct bt_context
*ctx
, int trace_id
);
68 * bt_context_get and bt_context_put : increments and decrement the
69 * refcount of the context
71 * These functions ensures that the context won't be destroyed when it
72 * is in use. The same number of get and put (plus one extra put to
73 * release the initial reference done at creation) has to be done to
76 * When the context refcount is decremented to 0 by a bt_context_put,
77 * the context is freed.
79 void bt_context_get(struct bt_context
*ctx
);
80 void bt_context_put(struct bt_context
*ctx
);
82 #endif /* _BABELTRACE_CONTEXT_H */
This page took 0.031303 seconds and 3 git commands to generate.