trace-handle.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #ifndef _BABELTRACE_TRACE_HANDLE_H
  2. #define _BABELTRACE_TRACE_HANDLE_H
  3. /*
  4. * BabelTrace
  5. *
  6. * trace_handle header
  7. *
  8. * Copyright 2012 EfficiOS Inc. and Linux Foundation
  9. *
  10. * Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  11. * Julien Desfossez <julien.desfossez@efficios.com>
  12. *
  13. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14. * of this software and associated documentation files (the "Software"), to deal
  15. * in the Software without restriction, including without limitation the rights
  16. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  17. * copies of the Software, and to permit persons to whom the Software is
  18. * furnished to do so, subject to the following conditions:
  19. *
  20. * The above copyright notice and this permission notice shall be included in
  21. * all copies or substantial portions of the Software.
  22. *
  23. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  24. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  25. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  26. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  27. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  28. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  29. * SOFTWARE.
  30. */
  31. #include <stdint.h>
  32. #include <babeltrace/clock-types.h>
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36. /*
  37. * trace_handle : unique identifier of a trace
  38. *
  39. * The trace_handle allows the user to manipulate a trace file directly.
  40. * It is a unique identifier representing a trace file.
  41. */
  42. struct bt_trace_handle;
  43. struct bt_ctf_event;
  44. /*
  45. * bt_trace_handle_get_path : returns the path of a trace_handle or NULL
  46. * on error.
  47. */
  48. const char *bt_trace_handle_get_path(struct bt_context *ctx, int handle_id);
  49. /*
  50. * bt_trace_handle_get_timestamp_begin : returns the creation time (in
  51. * nanoseconds or cycles depending on type) of the buffers of a trace
  52. * or -1ULL on error.
  53. */
  54. uint64_t bt_trace_handle_get_timestamp_begin(struct bt_context *ctx,
  55. int handle_id, enum bt_clock_type type);
  56. /*
  57. * bt_trace_handle_get_timestamp_end : returns the destruction timestamp
  58. * (in nanoseconds or cycles depending on type) of the buffers of a trace
  59. * or -1ULL on error.
  60. */
  61. uint64_t bt_trace_handle_get_timestamp_end(struct bt_context *ctx,
  62. int handle_id, enum bt_clock_type type);
  63. /*
  64. * bt_ctf_event_get_handle_id : get the handle id associated with an event
  65. *
  66. * Returns -1 on error
  67. */
  68. int bt_ctf_event_get_handle_id(const struct bt_ctf_event *event);
  69. #ifdef __cplusplus
  70. }
  71. #endif
  72. #endif /* _BABELTRACE_TRACE_HANDLE_H */