| 1 |
/* sysprof-document.h |
| 2 |
* |
| 3 |
* Copyright 2023 Christian Hergert <[email protected]> |
| 4 |
* |
| 5 |
* This program is free software: you can redistribute it and/or modify |
| 6 |
* it under the terms of the GNU General Public License as published by |
| 7 |
* the Free Software Foundation, either version 3 of the License, or |
| 8 |
* (at your option) any later version. |
| 9 |
* |
| 10 |
* This program is distributed in the hope that it will be useful, |
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
* GNU General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU General Public License |
| 16 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 |
* |
| 18 |
* SPDX-License-Identifier: GPL-3.0-or-later |
| 19 |
*/ |
| 20 |
|
| 21 |
#pragma once |
| 22 |
|
| 23 |
#include <gio/gio.h> |
| 24 |
|
| 25 |
#include <sysprof-capture.h> |
| 26 |
|
| 27 |
#include "sysprof-callgraph.h" |
| 28 |
#include "sysprof-document-counter.h" |
| 29 |
#include "sysprof-document-file.h" |
| 30 |
#include "sysprof-document-process.h" |
| 31 |
#include "sysprof-document-traceable.h" |
| 32 |
#include "sysprof-mark-catalog.h" |
| 33 |
#include "sysprof-symbol.h" |
| 34 |
#include "sysprof-time-span.h" |
| 35 |
|
| 36 |
G_BEGIN_DECLS |
| 37 |
|
| 38 |
#define SYSPROF_TYPE_DOCUMENT (sysprof_document_get_type()) |
| 39 |
|
| 40 |
SYSPROF_AVAILABLE_IN_ALL |
| 41 |
G_DECLARE_FINAL_TYPE (SysprofDocument, sysprof_document, SYSPROF, DOCUMENT, GObject) |
| 42 |
|
| 43 |
SYSPROF_AVAILABLE_IN_ALL |
| 44 |
char *sysprof_document_dup_title (SysprofDocument *self); |
| 45 |
SYSPROF_AVAILABLE_IN_ALL |
| 46 |
char *sysprof_document_dup_subtitle (SysprofDocument *self); |
| 47 |
SYSPROF_AVAILABLE_IN_ALL |
| 48 |
const SysprofTimeSpan *sysprof_document_get_time_span (SysprofDocument *self); |
| 49 |
SYSPROF_AVAILABLE_IN_ALL |
| 50 |
SysprofDocumentFile *sysprof_document_lookup_file (SysprofDocument *self, |
| 51 |
const char *path); |
| 52 |
SYSPROF_AVAILABLE_IN_ALL |
| 53 |
SysprofDocumentProcess *sysprof_document_lookup_process (SysprofDocument *self, |
| 54 |
int pid); |
| 55 |
SYSPROF_AVAILABLE_IN_ALL |
| 56 |
GListModel *sysprof_document_list_cpu_info (SysprofDocument *self); |
| 57 |
SYSPROF_AVAILABLE_IN_ALL |
| 58 |
GListModel *sysprof_document_list_files (SysprofDocument *self); |
| 59 |
SYSPROF_AVAILABLE_IN_ALL |
| 60 |
GListModel *sysprof_document_list_traceables (SysprofDocument *self); |
| 61 |
SYSPROF_AVAILABLE_IN_ALL |
| 62 |
GListModel *sysprof_document_list_allocations (SysprofDocument *self); |
| 63 |
SYSPROF_AVAILABLE_IN_ALL |
| 64 |
GListModel *sysprof_document_list_dbus_messages (SysprofDocument *self); |
| 65 |
SYSPROF_AVAILABLE_IN_ALL |
| 66 |
GListModel *sysprof_document_list_logs (SysprofDocument *self); |
| 67 |
SYSPROF_AVAILABLE_IN_ALL |
| 68 |
GListModel *sysprof_document_list_metadata (SysprofDocument *self); |
| 69 |
SYSPROF_AVAILABLE_IN_ALL |
| 70 |
GListModel *sysprof_document_list_samples (SysprofDocument *self); |
| 71 |
SYSPROF_AVAILABLE_IN_ALL |
| 72 |
GListModel *sysprof_document_list_samples_with_context_switch (SysprofDocument *self); |
| 73 |
SYSPROF_AVAILABLE_IN_ALL |
| 74 |
GListModel *sysprof_document_list_samples_without_context_switch (SysprofDocument *self); |
| 75 |
SYSPROF_AVAILABLE_IN_ALL |
| 76 |
GListModel *sysprof_document_list_processes (SysprofDocument *self); |
| 77 |
SYSPROF_AVAILABLE_IN_ALL |
| 78 |
GListModel *sysprof_document_list_jitmaps (SysprofDocument *self); |
| 79 |
SYSPROF_AVAILABLE_IN_ALL |
| 80 |
GListModel *sysprof_document_list_counters (SysprofDocument *self); |
| 81 |
SYSPROF_AVAILABLE_IN_ALL |
| 82 |
GListModel *sysprof_document_list_marks (SysprofDocument *self); |
| 83 |
SYSPROF_AVAILABLE_IN_ALL |
| 84 |
GListModel *sysprof_document_list_marks_by_group (SysprofDocument *self, |
| 85 |
const char *group); |
| 86 |
SYSPROF_AVAILABLE_IN_ALL |
| 87 |
GListModel *sysprof_document_catalog_marks (SysprofDocument *self); |
| 88 |
SYSPROF_AVAILABLE_IN_ALL |
| 89 |
SysprofDocumentCounter *sysprof_document_find_counter (SysprofDocument *self, |
| 90 |
const char *category, |
| 91 |
const char *name); |
| 92 |
SYSPROF_AVAILABLE_IN_ALL |
| 93 |
GListModel *sysprof_document_list_symbols_in_traceable (SysprofDocument *self, |
| 94 |
SysprofDocumentTraceable *traceable); |
| 95 |
SYSPROF_AVAILABLE_IN_ALL |
| 96 |
guint sysprof_document_symbolize_traceable (SysprofDocument *self, |
| 97 |
SysprofDocumentTraceable *traceable, |
| 98 |
SysprofSymbol **symbols, |
| 99 |
guint n_symbols, |
| 100 |
SysprofAddressContext *final_context); |
| 101 |
SYSPROF_AVAILABLE_IN_ALL |
| 102 |
void sysprof_document_callgraph_async (SysprofDocument *self, |
| 103 |
SysprofCallgraphFlags flags, |
| 104 |
GListModel *traceables, |
| 105 |
gsize augment_size, |
| 106 |
SysprofAugmentationFunc augment_func, |
| 107 |
gpointer augment_func_data, |
| 108 |
GDestroyNotify augment_func_data_destroy, |
| 109 |
GCancellable *cancellable, |
| 110 |
GAsyncReadyCallback callback, |
| 111 |
gpointer user_data); |
| 112 |
SYSPROF_AVAILABLE_IN_ALL |
| 113 |
SysprofCallgraph *sysprof_document_callgraph_finish (SysprofDocument *self, |
| 114 |
GAsyncResult *result, |
| 115 |
GError **error); |
| 116 |
SYSPROF_AVAILABLE_IN_ALL |
| 117 |
void sysprof_document_serialize_symbols_async (SysprofDocument *self, |
| 118 |
GCancellable *cancellable, |
| 119 |
GAsyncReadyCallback callback, |
| 120 |
gpointer user_data); |
| 121 |
SYSPROF_AVAILABLE_IN_ALL |
| 122 |
GBytes *sysprof_document_serialize_symbols_finish (SysprofDocument *self, |
| 123 |
GAsyncResult *result, |
| 124 |
GError **error); |
| 125 |
SYSPROF_AVAILABLE_IN_ALL |
| 126 |
void sysprof_document_save_async (SysprofDocument *self, |
| 127 |
GFile *file, |
| 128 |
GCancellable *cancellable, |
| 129 |
GAsyncReadyCallback callback, |
| 130 |
gpointer user_data); |
| 131 |
SYSPROF_AVAILABLE_IN_ALL |
| 132 |
gboolean sysprof_document_save_finish (SysprofDocument *self, |
| 133 |
GAsyncResult *result, |
| 134 |
GError **error); |
| 135 |
SYSPROF_AVAILABLE_IN_ALL |
| 136 |
gboolean sysprof_document_get_busy (SysprofDocument *self); |
| 137 |
|
| 138 |
G_END_DECLS |