From 8b88bfe693b003995960d078f0aa425864358955 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Wed, 8 May 2019 10:55:29 -0700 Subject: [PATCH] libsysprof: add versioning macros This also moves stackstash.[ch] into a location that can be embedded by both the libsysprof and libsysprof-ui code. We pass native pointers to the structure as a gpointer in the public API to allow for this. The performance of that code is incredibly sensitive to the interactivity of Sysprof. --- src/libsysprof-ui/meson.build | 1 + src/libsysprof-ui/sp-callgraph-view.c | 5 ++- src/libsysprof/demangle.h | 7 ++-- src/libsysprof/elfparser.h | 1 - src/libsysprof/meson.build | 16 +++++---- src/libsysprof/sp-callgraph-profile-private.h | 31 ----------------- src/libsysprof/sp-callgraph-profile.c | 14 +++++--- src/libsysprof/sp-callgraph-profile.h | 17 +++++++--- src/libsysprof/sp-capture-gobject.c | 4 +++ src/libsysprof/sp-capture-gobject.h | 6 +++- src/libsysprof/sp-elf-symbol-resolver.c | 8 +++-- src/libsysprof/sp-elf-symbol-resolver.h | 13 +++++--- src/libsysprof/sp-gjs-source.c | 6 +++- src/libsysprof/sp-gjs-source.h | 9 +++-- src/libsysprof/sp-hostinfo-source.c | 6 +++- src/libsysprof/sp-hostinfo-source.h | 14 ++++---- src/libsysprof/sp-jitmap-symbol-resolver.c | 6 +++- src/libsysprof/sp-jitmap-symbol-resolver.h | 9 +++-- src/libsysprof/sp-kallsyms.c | 2 ++ src/libsysprof/sp-kernel-symbol-resolver.c | 6 +++- src/libsysprof/sp-kernel-symbol-resolver.h | 9 +++-- src/libsysprof/sp-kernel-symbol.c | 4 ++- src/libsysprof/sp-kernel-symbol.h | 9 +++-- src/libsysprof/sp-line-reader.c | 2 ++ src/libsysprof/sp-local-profiler.c | 6 +++- src/libsysprof/sp-local-profiler.h | 13 +++++--- src/libsysprof/sp-map-lookaside.c | 6 +++- src/libsysprof/sp-map-lookaside.h | 9 +++-- src/libsysprof/sp-memory-source.c | 6 ++-- src/libsysprof/sp-memory-source.h | 6 +++- src/libsysprof/sp-perf-counter.c | 4 ++- src/libsysprof/sp-perf-counter.h | 9 +++-- src/libsysprof/sp-perf-source.c | 4 ++- src/libsysprof/sp-perf-source.h | 14 +++++--- src/libsysprof/sp-proc-source.c | 6 +++- src/libsysprof/sp-proc-source.h | 14 +++++--- src/libsysprof/sp-process-model-item.c | 6 +++- src/libsysprof/sp-process-model-item.h | 19 ++++++++--- src/libsysprof/sp-process-model.c | 6 +++- src/libsysprof/sp-process-model.h | 15 ++++++--- src/libsysprof/sp-profile.c | 6 +++- src/libsysprof/sp-profile.h | 15 ++++++--- src/libsysprof/sp-profiler.c | 8 ++++- src/libsysprof/sp-profiler.h | 33 ++++++++++++++++--- src/libsysprof/sp-selection.c | 6 +++- src/libsysprof/sp-selection.h | 19 ++++++++--- src/libsysprof/sp-source-util.c | 2 ++ src/libsysprof/sp-source.c | 6 +++- src/libsysprof/sp-source.h | 9 +++-- src/libsysprof/sp-symbol-dirs.c | 4 ++- src/libsysprof/sp-symbol-dirs.h | 9 +++-- src/libsysprof/sp-symbol-resolver.c | 6 +++- src/libsysprof/sp-symbol-resolver.h | 9 +++-- src/libsysprof/sysprof.h | 2 +- src/{libsysprof => }/stackstash.c | 0 src/{libsysprof => }/stackstash.h | 0 56 files changed, 305 insertions(+), 177 deletions(-) delete mode 100644 src/libsysprof/sp-callgraph-profile-private.h rename src/{libsysprof => }/stackstash.c (100%) rename src/{libsysprof => }/stackstash.h (100%) diff --git a/src/libsysprof-ui/meson.build b/src/libsysprof-ui/meson.build index 3789dcc4..6c5c9b48 100644 --- a/src/libsysprof-ui/meson.build +++ b/src/libsysprof-ui/meson.build @@ -23,6 +23,7 @@ libsysprof_ui_private_sources = [ 'rectangles.c', 'sp-cell-renderer-percent.c', 'sp-theme-manager.c', + '../stackstash.c', ] libsysprof_ui_public_headers = [ diff --git a/src/libsysprof-ui/sp-callgraph-view.c b/src/libsysprof-ui/sp-callgraph-view.c index 2385ff02..b9e0bd72 100644 --- a/src/libsysprof-ui/sp-callgraph-view.c +++ b/src/libsysprof-ui/sp-callgraph-view.c @@ -37,9 +37,12 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "config.h" + #include -#include "sp-callgraph-profile-private.h" +#include "../stackstash.h" + #include "sp-callgraph-view.h" #include "sp-cell-renderer-percent.h" diff --git a/src/libsysprof/demangle.h b/src/libsysprof/demangle.h index bbd482da..7a005863 100644 --- a/src/libsysprof/demangle.h +++ b/src/libsysprof/demangle.h @@ -1,6 +1,6 @@ /* demangle.h * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,7 @@ * along with this program. If not, see . */ -#ifndef DEMANGLE_H -#define DEMANGLE_H +#pragma once #include @@ -26,5 +25,3 @@ G_BEGIN_DECLS gchar *sysprof_cplus_demangle (const gchar *name); G_END_DECLS - -#endif /* DEMANGLE_H */ diff --git a/src/libsysprof/elfparser.h b/src/libsysprof/elfparser.h index c01274c1..17986e7f 100644 --- a/src/libsysprof/elfparser.h +++ b/src/libsysprof/elfparser.h @@ -54,4 +54,3 @@ gulong elf_parser_get_sym_address (ElfParser *parser, gboolean elf_parser_owns_symbol (ElfParser *parser, const ElfSym *sym); char * elf_demangle (const char *name); - diff --git a/src/libsysprof/meson.build b/src/libsysprof/meson.build index 2186d099..91a91485 100644 --- a/src/libsysprof/meson.build +++ b/src/libsysprof/meson.build @@ -23,7 +23,6 @@ libsysprof_public_sources = [ libsysprof_public_headers = [ 'sp-callgraph-profile.h', - 'sp-callgraph-profile-private.h', 'sp-capture-gobject.h', 'sp-elf-symbol-resolver.h', 'sp-hostinfo-source.h', @@ -45,10 +44,10 @@ libsysprof_public_headers = [ ] libsysprof_private_sources = [ + '../stackstash.c', 'binfile.c', 'demangle.cpp', 'elfparser.c', - 'stackstash.c', 'sp-source-util.c', 'sp-line-reader.c', ] @@ -90,12 +89,15 @@ if get_option('with_sysprofd') != 'none' libsysprof_deps += dependency('polkit-gobject-1') endif -libsysprof = shared_library('sysprof-@0@'.format(libsysprof_api_version), +libsysprof = shared_library( + 'sysprof-@0@'.format(libsysprof_api_version), libsysprof_public_sources + libsysprof_private_sources, - dependencies: libsysprof_deps, - c_args: libsysprof_c_args, - install: true, - install_dir: get_option('libdir'), + + dependencies: libsysprof_deps, + c_args: libsysprof_c_args, + install: true, + install_dir: get_option('libdir'), + gnu_symbol_visibility: 'hidden', ) libsysprof_dep = declare_dependency( diff --git a/src/libsysprof/sp-callgraph-profile-private.h b/src/libsysprof/sp-callgraph-profile-private.h deleted file mode 100644 index 62816f53..00000000 --- a/src/libsysprof/sp-callgraph-profile-private.h +++ /dev/null @@ -1,31 +0,0 @@ -/* sp-callgraph-profile-private.h - * - * Copyright 2016 Christian Hergert - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef SP_CALLGRAPH_PROFILE_PRIVATE_H -#define SP_CALLGRAPH_PROFILE_PRIVATE_H - -#include "sp-callgraph-profile.h" -#include "stackstash.h" - -G_BEGIN_DECLS - -StackStash *sp_callgraph_profile_get_stash (SpCallgraphProfile *self); - -G_END_DECLS - -#endif /* SP_CALLGRAPH_PROFILE_PRIVATE_H */ diff --git a/src/libsysprof/sp-callgraph-profile.c b/src/libsysprof/sp-callgraph-profile.c index 119ebb9f..2707bb31 100644 --- a/src/libsysprof/sp-callgraph-profile.c +++ b/src/libsysprof/sp-callgraph-profile.c @@ -1,6 +1,6 @@ /* sp-callgraph-profile.c * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ /* Sysprof -- Sampling, systemwide CPU profiler @@ -34,20 +36,22 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "config.h" + #include #include #include #include +#include "../stackstash.h" + #include "sp-callgraph-profile.h" -#include "sp-callgraph-profile-private.h" #include "sp-capture-reader.h" #include "sp-elf-symbol-resolver.h" #include "sp-jitmap-symbol-resolver.h" -#include "sp-map-lookaside.h" #include "sp-kernel-symbol-resolver.h" +#include "sp-map-lookaside.h" #include "sp-selection.h" -#include "stackstash.h" #define CHECK_CANCELLABLE_INTERVAL 100 @@ -499,7 +503,7 @@ profile_iface_init (SpProfileInterface *iface) iface->set_reader = sp_callgraph_profile_set_reader; } -StackStash * +gpointer sp_callgraph_profile_get_stash (SpCallgraphProfile *self) { g_return_val_if_fail (SP_IS_CALLGRAPH_PROFILE (self), NULL); diff --git a/src/libsysprof/sp-callgraph-profile.h b/src/libsysprof/sp-callgraph-profile.h index 0ff02a11..951908f7 100644 --- a/src/libsysprof/sp-callgraph-profile.h +++ b/src/libsysprof/sp-callgraph-profile.h @@ -1,6 +1,6 @@ /* sp-callgraph-profile.h * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,10 +14,13 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ -#ifndef SP_CALLGRAPH_PROFILE_H -#define SP_CALLGRAPH_PROFILE_H +#pragma once + +#include "sysprof-version-macros.h" #include "sp-profile.h" #include "sp-selection.h" @@ -26,13 +29,17 @@ G_BEGIN_DECLS #define SP_TYPE_CALLGRAPH_PROFILE (sp_callgraph_profile_get_type()) +SYSPROF_AVAILABLE_IN_ALL G_DECLARE_FINAL_TYPE (SpCallgraphProfile, sp_callgraph_profile, SP, CALLGRAPH_PROFILE, GObject) +SYSPROF_AVAILABLE_IN_ALL SpProfile *sp_callgraph_profile_new (void); +SYSPROF_AVAILABLE_IN_ALL SpProfile *sp_callgraph_profile_new_with_selection (SpSelection *selection); +SYSPROF_AVAILABLE_IN_ALL +gpointer sp_callgraph_profile_get_stash (SpCallgraphProfile *self); +SYSPROF_AVAILABLE_IN_ALL GQuark sp_callgraph_profile_get_tag (SpCallgraphProfile *self, const gchar *symbol); G_END_DECLS - -#endif /* SP_CALLGRAPH_PROFILE_H */ diff --git a/src/libsysprof/sp-capture-gobject.c b/src/libsysprof/sp-capture-gobject.c index 9fa0294d..f6717df2 100644 --- a/src/libsysprof/sp-capture-gobject.c +++ b/src/libsysprof/sp-capture-gobject.c @@ -18,8 +18,12 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ +#include "config.h" + #include "sp-capture-gobject.h" +#include + G_DEFINE_BOXED_TYPE (SpCaptureReader, sp_capture_reader, (GBoxedCopyFunc)sp_capture_reader_ref, (GBoxedFreeFunc)sp_capture_reader_unref) G_DEFINE_BOXED_TYPE (SpCaptureWriter, sp_capture_writer, (GBoxedCopyFunc)sp_capture_writer_ref, (GBoxedFreeFunc)sp_capture_writer_unref) G_DEFINE_BOXED_TYPE (SpCaptureCursor, sp_capture_cursor, (GBoxedCopyFunc)sp_capture_cursor_ref, (GBoxedFreeFunc)sp_capture_cursor_unref) diff --git a/src/libsysprof/sp-capture-gobject.h b/src/libsysprof/sp-capture-gobject.h index 540da2f2..c7b791b7 100644 --- a/src/libsysprof/sp-capture-gobject.h +++ b/src/libsysprof/sp-capture-gobject.h @@ -21,7 +21,8 @@ #pragma once #include -#include + +#include "sysprof-version-macros.h" G_BEGIN_DECLS @@ -29,8 +30,11 @@ G_BEGIN_DECLS #define SP_TYPE_CAPTURE_WRITER (sp_capture_writer_get_type()) #define SP_TYPE_CAPTURE_CURSOR (sp_capture_cursor_get_type()) +SYSPROF_AVAILABLE_IN_ALL GType sp_capture_reader_get_type (void); +SYSPROF_AVAILABLE_IN_ALL GType sp_capture_writer_get_type (void); +SYSPROF_AVAILABLE_IN_ALL GType sp_capture_cursor_get_type (void); G_END_DECLS diff --git a/src/libsysprof/sp-elf-symbol-resolver.c b/src/libsysprof/sp-elf-symbol-resolver.c index c967aaf6..a62f21e3 100644 --- a/src/libsysprof/sp-elf-symbol-resolver.c +++ b/src/libsysprof/sp-elf-symbol-resolver.c @@ -1,6 +1,6 @@ /* sp-elf-symbol-resolver.c * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,13 +14,17 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ +#include "config.h" + #include -#include "sp-elf-symbol-resolver.h" #include "binfile.h" #include "elfparser.h" +#include "sp-elf-symbol-resolver.h" #include "sp-map-lookaside.h" struct _SpElfSymbolResolver diff --git a/src/libsysprof/sp-elf-symbol-resolver.h b/src/libsysprof/sp-elf-symbol-resolver.h index 659c6ee0..f87e7017 100644 --- a/src/libsysprof/sp-elf-symbol-resolver.h +++ b/src/libsysprof/sp-elf-symbol-resolver.h @@ -1,6 +1,6 @@ /* sp-elf-symbol-resolver.h * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,10 +14,13 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ -#ifndef SP_ELF_SYMBOL_RESOLVER_H -#define SP_ELF_SYMBOL_RESOLVER_H +#pragma once + +#include "sysprof-version-macros.h" #include "sp-symbol-resolver.h" @@ -25,10 +28,10 @@ G_BEGIN_DECLS #define SP_TYPE_ELF_SYMBOL_RESOLVER (sp_elf_symbol_resolver_get_type()) +SYSPROF_AVAILABLE_IN_ALL G_DECLARE_FINAL_TYPE (SpElfSymbolResolver, sp_elf_symbol_resolver, SP, ELF_SYMBOL_RESOLVER, GObject) +SYSPROF_AVAILABLE_IN_ALL SpSymbolResolver *sp_elf_symbol_resolver_new (void); G_END_DECLS - -#endif /* SP_ELF_SYMBOL_RESOLVER_H */ diff --git a/src/libsysprof/sp-gjs-source.c b/src/libsysprof/sp-gjs-source.c index 615fe7e0..065d4910 100644 --- a/src/libsysprof/sp-gjs-source.c +++ b/src/libsysprof/sp-gjs-source.c @@ -1,6 +1,6 @@ /* sp-gjs-source.c * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +14,12 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ +#include "config.h" + #include #include diff --git a/src/libsysprof/sp-gjs-source.h b/src/libsysprof/sp-gjs-source.h index 94836c36..fe98ee15 100644 --- a/src/libsysprof/sp-gjs-source.h +++ b/src/libsysprof/sp-gjs-source.h @@ -1,6 +1,6 @@ /* sp-gjs-source.h * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,10 +14,11 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ -#ifndef SP_GJS_SOURCE_H -#define SP_GJS_SOURCE_H +#pragma once #include "sp-source.h" @@ -30,5 +31,3 @@ G_DECLARE_FINAL_TYPE (SpGjsSource, sp_gjs_source, SP, GJS_SOURCE, GObject) SpSource *sp_gjs_source_new (void); G_END_DECLS - -#endif /* SP_GJS_SOURCE_H */ diff --git a/src/libsysprof/sp-hostinfo-source.c b/src/libsysprof/sp-hostinfo-source.c index 972978fa..af15320a 100644 --- a/src/libsysprof/sp-hostinfo-source.c +++ b/src/libsysprof/sp-hostinfo-source.c @@ -1,6 +1,6 @@ /* sp-hostinfo-source.c * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +14,12 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ +#include "config.h" + #include #include #include diff --git a/src/libsysprof/sp-hostinfo-source.h b/src/libsysprof/sp-hostinfo-source.h index 2bd4a75b..b4468a4b 100644 --- a/src/libsysprof/sp-hostinfo-source.h +++ b/src/libsysprof/sp-hostinfo-source.h @@ -1,6 +1,6 @@ /* sp-hostinfo-source.h * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,10 +14,13 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ -#ifndef SP_HOSTINFO_SOURCE_H -#define SP_HOSTINFO_SOURCE_H +#pragma once + +#include "sysprof-version-macros.h" #include "sp-source.h" @@ -25,11 +28,10 @@ G_BEGIN_DECLS #define SP_TYPE_HOSTINFO_SOURCE (sp_hostinfo_source_get_type()) +SYSPROF_AVAILABLE_IN_ALL G_DECLARE_FINAL_TYPE (SpHostinfoSource, sp_hostinfo_source, SP, HOSTINFO_SOURCE, GObject) +SYSPROF_AVAILABLE_IN_ALL SpSource *sp_hostinfo_source_new (void); G_END_DECLS - -#endif /* SP_HOSTINFO_SOURCE_H */ - diff --git a/src/libsysprof/sp-jitmap-symbol-resolver.c b/src/libsysprof/sp-jitmap-symbol-resolver.c index fccd2b16..2f3c454c 100644 --- a/src/libsysprof/sp-jitmap-symbol-resolver.c +++ b/src/libsysprof/sp-jitmap-symbol-resolver.c @@ -1,6 +1,6 @@ /* sp-jitmap-symbol-resolver.c * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +14,12 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ +#include "config.h" + #include "sp-kernel-symbol.h" #include "sp-jitmap-symbol-resolver.h" diff --git a/src/libsysprof/sp-jitmap-symbol-resolver.h b/src/libsysprof/sp-jitmap-symbol-resolver.h index daf32b1f..e1c6abd4 100644 --- a/src/libsysprof/sp-jitmap-symbol-resolver.h +++ b/src/libsysprof/sp-jitmap-symbol-resolver.h @@ -1,6 +1,6 @@ /* sp-jitmap-symbol-resolver.h * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,10 +14,11 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ -#ifndef SP_JITMAP_SYMBOL_RESOLVER_H -#define SP_JITMAP_SYMBOL_RESOLVER_H +#pragma once #include "sp-symbol-resolver.h" @@ -30,5 +31,3 @@ G_DECLARE_FINAL_TYPE (SpJitmapSymbolResolver, sp_jitmap_symbol_resolver, SP, JIT SpSymbolResolver *sp_jitmap_symbol_resolver_new (void); G_END_DECLS - -#endif /* SP_JITMAP_SYMBOL_RESOLVER_H */ diff --git a/src/libsysprof/sp-kallsyms.c b/src/libsysprof/sp-kallsyms.c index 7a4b0d4d..c8a0e05c 100644 --- a/src/libsysprof/sp-kallsyms.c +++ b/src/libsysprof/sp-kallsyms.c @@ -20,6 +20,8 @@ #define G_LOG_DOMAIN "sp-kallsyms" +#include "config.h" + #ifndef _GNU_SOURCE # define _GNU_SOURCE #endif diff --git a/src/libsysprof/sp-kernel-symbol-resolver.c b/src/libsysprof/sp-kernel-symbol-resolver.c index 8d38e2ea..672ade18 100644 --- a/src/libsysprof/sp-kernel-symbol-resolver.c +++ b/src/libsysprof/sp-kernel-symbol-resolver.c @@ -1,6 +1,6 @@ /* sp-kernel-symbol-resolver.c * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +14,12 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ +#include "config.h" + #include "sp-kernel-symbol.h" #include "sp-kernel-symbol-resolver.h" diff --git a/src/libsysprof/sp-kernel-symbol-resolver.h b/src/libsysprof/sp-kernel-symbol-resolver.h index e1c0c9cf..b9d722b9 100644 --- a/src/libsysprof/sp-kernel-symbol-resolver.h +++ b/src/libsysprof/sp-kernel-symbol-resolver.h @@ -1,6 +1,6 @@ /* sp-kernel-symbol-resolver.h * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,10 +14,11 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ -#ifndef SP_KERNEL_SYMBOL_RESOLVER_H -#define SP_KERNEL_SYMBOL_RESOLVER_H +#pragma once #include "sp-symbol-resolver.h" @@ -30,5 +31,3 @@ G_DECLARE_FINAL_TYPE (SpKernelSymbolResolver, sp_kernel_symbol_resolver, SP, KER SpSymbolResolver *sp_kernel_symbol_resolver_new (void); G_END_DECLS - -#endif /* SP_KERNEL_SYMBOL_RESOLVER_H */ diff --git a/src/libsysprof/sp-kernel-symbol.c b/src/libsysprof/sp-kernel-symbol.c index 37f8c699..ee780a3e 100644 --- a/src/libsysprof/sp-kernel-symbol.c +++ b/src/libsysprof/sp-kernel-symbol.c @@ -1,6 +1,6 @@ /* sp-kernel-symbol.c * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ #define G_LOG_DOMAIN "sp-kernel-symbol" diff --git a/src/libsysprof/sp-kernel-symbol.h b/src/libsysprof/sp-kernel-symbol.h index b2b73648..5e83f2cc 100644 --- a/src/libsysprof/sp-kernel-symbol.h +++ b/src/libsysprof/sp-kernel-symbol.h @@ -1,6 +1,6 @@ /* sp-kernel-symbol.h * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,10 +14,11 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ -#ifndef SP_KERNEL_SYMBOL_H -#define SP_KERNEL_SYMBOL_H +#pragma once #include "sp-capture-types.h" @@ -32,5 +33,3 @@ typedef struct const SpKernelSymbol *sp_kernel_symbol_from_address (SpCaptureAddress address); G_END_DECLS - -#endif /* SP_KERNEL_SYMBOL_H */ diff --git a/src/libsysprof/sp-line-reader.c b/src/libsysprof/sp-line-reader.c index a61c537e..f39885f0 100644 --- a/src/libsysprof/sp-line-reader.c +++ b/src/libsysprof/sp-line-reader.c @@ -18,6 +18,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ +#include "config.h" + #include #include "sp-line-reader.h" diff --git a/src/libsysprof/sp-local-profiler.c b/src/libsysprof/sp-local-profiler.c index 47b5f534..f0460d06 100644 --- a/src/libsysprof/sp-local-profiler.c +++ b/src/libsysprof/sp-local-profiler.c @@ -1,6 +1,6 @@ /* sp-local-profiler.c * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +14,12 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ +#include "config.h" + #include #include #include diff --git a/src/libsysprof/sp-local-profiler.h b/src/libsysprof/sp-local-profiler.h index 2acffddc..58cd8067 100644 --- a/src/libsysprof/sp-local-profiler.h +++ b/src/libsysprof/sp-local-profiler.h @@ -1,6 +1,6 @@ /* sp-local-profiler.h * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,17 +14,21 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ -#ifndef SP_LOCAL_PROFILER_H -#define SP_LOCAL_PROFILER_H +#pragma once #include "sp-profiler.h" +#include "sysprof-version-macros.h" + G_BEGIN_DECLS #define SP_TYPE_LOCAL_PROFILER (sp_local_profiler_get_type()) +SYSPROF_AVAILABLE_IN_ALL G_DECLARE_DERIVABLE_TYPE (SpLocalProfiler, sp_local_profiler, SP, LOCAL_PROFILER, GObject) struct _SpLocalProfilerClass @@ -33,8 +37,7 @@ struct _SpLocalProfilerClass gpointer padding[8]; }; +SYSPROF_AVAILABLE_IN_ALL SpProfiler *sp_local_profiler_new (void); G_END_DECLS - -#endif /* SP_LOCAL_PROFILER_H */ diff --git a/src/libsysprof/sp-map-lookaside.c b/src/libsysprof/sp-map-lookaside.c index 0a9231da..7b634e5b 100644 --- a/src/libsysprof/sp-map-lookaside.c +++ b/src/libsysprof/sp-map-lookaside.c @@ -1,6 +1,6 @@ /* sp-map-lookaside.c * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +14,12 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ +#include "config.h" + #include "sp-map-lookaside.h" struct _SpMapLookaside diff --git a/src/libsysprof/sp-map-lookaside.h b/src/libsysprof/sp-map-lookaside.h index 5de7bdba..34c85ec4 100644 --- a/src/libsysprof/sp-map-lookaside.h +++ b/src/libsysprof/sp-map-lookaside.h @@ -1,6 +1,6 @@ /* sp-map-lookaside.h * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,10 +14,11 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ -#ifndef SP_MAP_LOOKASIDE_H -#define SP_MAP_LOOKASIDE_H +#pragma once #include @@ -46,5 +47,3 @@ void sp_map_lookaside_free (SpMapLookaside *self); G_DEFINE_AUTOPTR_CLEANUP_FUNC (SpMapLookaside, sp_map_lookaside_free) G_END_DECLS - -#endif /* SP_MAP_LOOKASIDE_H */ diff --git a/src/libsysprof/sp-memory-source.c b/src/libsysprof/sp-memory-source.c index 44a21ce0..1347fe3b 100644 --- a/src/libsysprof/sp-memory-source.c +++ b/src/libsysprof/sp-memory-source.c @@ -1,6 +1,6 @@ /* sp-memory-source.c * - * Copyright 2018 Christian Hergert + * Copyright 2018-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,10 +18,10 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -#include "config.h" - #define G_LOG_DOMAIN "sp-memory-source" +#include "config.h" + #include #include #include diff --git a/src/libsysprof/sp-memory-source.h b/src/libsysprof/sp-memory-source.h index a3aa29f9..c0203924 100644 --- a/src/libsysprof/sp-memory-source.h +++ b/src/libsysprof/sp-memory-source.h @@ -1,6 +1,6 @@ /* sp-memory-source.h * - * Copyright 2018 Christian Hergert + * Copyright 2018-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,14 +20,18 @@ #pragma once +#include "sysprof-version-macros.h" + #include "sp-source.h" G_BEGIN_DECLS #define SP_TYPE_MEMORY_SOURCE (sp_memory_source_get_type()) +SYSPROF_AVAILABLE_IN_ALL G_DECLARE_FINAL_TYPE (SpMemorySource, sp_memory_source, SP, MEMORY_SOURCE, GObject) +SYSPROF_AVAILABLE_IN_ALL SpSource *sp_memory_source_new (void); G_END_DECLS diff --git a/src/libsysprof/sp-perf-counter.c b/src/libsysprof/sp-perf-counter.c index 65f5728c..0accf95e 100644 --- a/src/libsysprof/sp-perf-counter.c +++ b/src/libsysprof/sp-perf-counter.c @@ -1,6 +1,6 @@ /* sp-perf-counter.c * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ /* Sysprof -- Sampling, systemwide CPU profiler diff --git a/src/libsysprof/sp-perf-counter.h b/src/libsysprof/sp-perf-counter.h index f20fce90..141c1405 100644 --- a/src/libsysprof/sp-perf-counter.h +++ b/src/libsysprof/sp-perf-counter.h @@ -1,6 +1,6 @@ /* sp-perf-counter.h * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,10 +14,11 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ -#ifndef SP_PERF_COUNTER_H -#define SP_PERF_COUNTER_H +#pragma once #include #include @@ -150,5 +151,3 @@ SpPerfCounter *sp_perf_counter_ref (SpPerfCounter *self); void sp_perf_counter_unref (SpPerfCounter *self); G_END_DECLS - -#endif /* SP_PERF_COUNTER_H */ diff --git a/src/libsysprof/sp-perf-source.c b/src/libsysprof/sp-perf-source.c index f231da47..9ae3b801 100644 --- a/src/libsysprof/sp-perf-source.c +++ b/src/libsysprof/sp-perf-source.c @@ -1,6 +1,6 @@ /* sp-perf-source.c * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ /* Sysprof -- Sampling, systemwide CPU profiler diff --git a/src/libsysprof/sp-perf-source.h b/src/libsysprof/sp-perf-source.h index b52d5c29..1be7989d 100644 --- a/src/libsysprof/sp-perf-source.h +++ b/src/libsysprof/sp-perf-source.h @@ -1,6 +1,6 @@ /* sp-perf-source.h * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,10 +14,13 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ -#ifndef SP_PERF_SOURCE_H -#define SP_PERF_SOURCE_H +#pragma once + +#include "sysprof-version-macros.h" #include "sp-source.h" @@ -25,12 +28,13 @@ G_BEGIN_DECLS #define SP_TYPE_PERF_SOURCE (sp_perf_source_get_type()) +SYSPROF_AVAILABLE_IN_ALL G_DECLARE_FINAL_TYPE (SpPerfSource, sp_perf_source, SP, PERF_SOURCE, GObject) +SYSPROF_AVAILABLE_IN_ALL SpSource *sp_perf_source_new (void); +SYSPROF_AVAILABLE_IN_ALL void sp_perf_source_set_target_pid (SpPerfSource *self, GPid pid); G_END_DECLS - -#endif /* SP_PERF_SOURCE_H */ diff --git a/src/libsysprof/sp-proc-source.c b/src/libsysprof/sp-proc-source.c index 4edd1764..80e48edc 100644 --- a/src/libsysprof/sp-proc-source.c +++ b/src/libsysprof/sp-proc-source.c @@ -1,6 +1,6 @@ /* sp-proc-source.c * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ /* Sysprof -- Sampling, systemwide CPU profiler @@ -35,6 +37,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "config.h" + #include #include #include diff --git a/src/libsysprof/sp-proc-source.h b/src/libsysprof/sp-proc-source.h index 7d1bce85..bdfd7dda 100644 --- a/src/libsysprof/sp-proc-source.h +++ b/src/libsysprof/sp-proc-source.h @@ -1,6 +1,6 @@ /* sp-proc-source.h * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,10 +14,13 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ -#ifndef SP_PROC_SOURCE_H -#define SP_PROC_SOURCE_H +#pragma once + +#include "sysprof-version-macros.h" #include "sp-source.h" @@ -25,12 +28,13 @@ G_BEGIN_DECLS #define SP_TYPE_PROC_SOURCE (sp_proc_source_get_type()) +SYSPROF_AVAILABLE_IN_ALL G_DECLARE_FINAL_TYPE (SpProcSource, sp_proc_source, SP, PROC_SOURCE, GObject) +SYSPROF_AVAILABLE_IN_ALL SpSource *sp_proc_source_new (void); +SYSPROF_AVAILABLE_IN_ALL gchar *sp_proc_source_get_command_line (GPid pid, gboolean *is_kernel); G_END_DECLS - -#endif /* SP_PROC_SOURCE_H */ diff --git a/src/libsysprof/sp-process-model-item.c b/src/libsysprof/sp-process-model-item.c index 61cbaf55..00b5b791 100644 --- a/src/libsysprof/sp-process-model-item.c +++ b/src/libsysprof/sp-process-model-item.c @@ -1,6 +1,6 @@ /* sp-process-model-item.c * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +14,12 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ +#include "config.h" + #include #include "sp-process-model-item.h" diff --git a/src/libsysprof/sp-process-model-item.h b/src/libsysprof/sp-process-model-item.h index ec5b0e9d..693b6337 100644 --- a/src/libsysprof/sp-process-model-item.h +++ b/src/libsysprof/sp-process-model-item.h @@ -1,6 +1,6 @@ /* sp-process-model-item.h * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,10 +14,13 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ -#ifndef SP_PROCESS_MODEL_ITEM_H -#define SP_PROCESS_MODEL_ITEM_H +#pragma once + +#include "sysprof-version-macros.h" #include @@ -25,17 +28,23 @@ G_BEGIN_DECLS #define SP_TYPE_PROCESS_MODEL_ITEM (sp_process_model_item_get_type()) +SYSPROF_AVAILABLE_IN_ALL G_DECLARE_FINAL_TYPE (SpProcessModelItem, sp_process_model_item, SP, PROCESS_MODEL_ITEM, GObject) +SYSPROF_AVAILABLE_IN_ALL SpProcessModelItem *sp_process_model_item_new (GPid pid); +SYSPROF_AVAILABLE_IN_ALL guint sp_process_model_item_hash (SpProcessModelItem *self); +SYSPROF_AVAILABLE_IN_ALL gboolean sp_process_model_item_equal (SpProcessModelItem *self, SpProcessModelItem *other); +SYSPROF_AVAILABLE_IN_ALL GPid sp_process_model_item_get_pid (SpProcessModelItem *self); +SYSPROF_AVAILABLE_IN_ALL const gchar *sp_process_model_item_get_command_line (SpProcessModelItem *self); +SYSPROF_AVAILABLE_IN_ALL gboolean sp_process_model_item_is_kernel (SpProcessModelItem *self); +SYSPROF_AVAILABLE_IN_ALL const gchar * const *sp_process_model_item_get_argv (SpProcessModelItem *self); G_END_DECLS - -#endif /* SP_PROCESS_MODEL_ITEM_H */ diff --git a/src/libsysprof/sp-process-model.c b/src/libsysprof/sp-process-model.c index 198ab8d8..44ce4e3a 100644 --- a/src/libsysprof/sp-process-model.c +++ b/src/libsysprof/sp-process-model.c @@ -1,6 +1,6 @@ /* sp-process-model.c * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +14,12 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ +#include "config.h" + #include #include "sp-process-model.h" diff --git a/src/libsysprof/sp-process-model.h b/src/libsysprof/sp-process-model.h index a4a878ed..ccb9a6f5 100644 --- a/src/libsysprof/sp-process-model.h +++ b/src/libsysprof/sp-process-model.h @@ -1,6 +1,6 @@ /* sp-process-model.h * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,23 +14,28 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ -#ifndef SP_PROCESS_MODEL_H -#define SP_PROCESS_MODEL_H +#pragma once #include +#include "sysprof-version-macros.h" + G_BEGIN_DECLS #define SP_TYPE_PROCESS_MODEL (sp_process_model_get_type()) +SYSPROF_AVAILABLE_IN_ALL G_DECLARE_FINAL_TYPE (SpProcessModel, sp_process_model, SP, PROCESS_MODEL, GObject) +SYSPROF_AVAILABLE_IN_ALL SpProcessModel *sp_process_model_new (void); +SYSPROF_AVAILABLE_IN_ALL void sp_process_model_reload (SpProcessModel *self); +SYSPROF_AVAILABLE_IN_ALL void sp_process_model_queue_reload (SpProcessModel *self); G_END_DECLS - -#endif /* SP_PROCESS_MODEL_H */ diff --git a/src/libsysprof/sp-profile.c b/src/libsysprof/sp-profile.c index 01f75ebd..69086015 100644 --- a/src/libsysprof/sp-profile.c +++ b/src/libsysprof/sp-profile.c @@ -1,6 +1,6 @@ /* sp-profile.c * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +14,12 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ +#include "config.h" + #include "sp-profile.h" G_DEFINE_INTERFACE (SpProfile, sp_profile, G_TYPE_OBJECT) diff --git a/src/libsysprof/sp-profile.h b/src/libsysprof/sp-profile.h index c7fcbc95..0fa10138 100644 --- a/src/libsysprof/sp-profile.h +++ b/src/libsysprof/sp-profile.h @@ -1,6 +1,6 @@ /* sp-profile.h * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,19 +14,23 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ -#ifndef SP_PROFILE_H -#define SP_PROFILE_H +#pragma once #include +#include "sysprof-version-macros.h" + #include "sp-capture-reader.h" G_BEGIN_DECLS #define SP_TYPE_PROFILE (sp_profile_get_type ()) +SYSPROF_AVAILABLE_IN_ALL G_DECLARE_INTERFACE (SpProfile, sp_profile, SP, PROFILE, GObject) struct _SpProfileInterface @@ -44,16 +48,17 @@ struct _SpProfileInterface GError **error); }; +SYSPROF_AVAILABLE_IN_ALL void sp_profile_set_reader (SpProfile *self, SpCaptureReader *reader); +SYSPROF_AVAILABLE_IN_ALL void sp_profile_generate (SpProfile *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); +SYSPROF_AVAILABLE_IN_ALL gboolean sp_profile_generate_finish (SpProfile *self, GAsyncResult *result, GError **error); G_END_DECLS - -#endif /* SP_PROFILE_H */ diff --git a/src/libsysprof/sp-profiler.c b/src/libsysprof/sp-profiler.c index 290efc4e..02874797 100644 --- a/src/libsysprof/sp-profiler.c +++ b/src/libsysprof/sp-profiler.c @@ -1,6 +1,6 @@ /* sp-profiler.c * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +14,14 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ +#define G_LOG_DOMAIN "sp-profiler" + +#include "config.h" + #include "sp-profiler.h" G_DEFINE_INTERFACE (SpProfiler, sp_profiler, G_TYPE_OBJECT) diff --git a/src/libsysprof/sp-profiler.h b/src/libsysprof/sp-profiler.h index 638a61a1..8800b416 100644 --- a/src/libsysprof/sp-profiler.h +++ b/src/libsysprof/sp-profiler.h @@ -1,6 +1,6 @@ /* sp-profiler.h * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,10 +14,13 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ -#ifndef SP_PROFILER_H -#define SP_PROFILER_H +#pragma once + +#include "sysprof-version-macros.h" #include "sp-capture-writer.h" #include "sp-source.h" @@ -26,6 +29,7 @@ G_BEGIN_DECLS #define SP_TYPE_PROFILER (sp_profiler_get_type()) +SYSPROF_AVAILABLE_IN_ALL G_DECLARE_INTERFACE (SpProfiler, sp_profiler, SP, PROFILER, GObject) struct _SpProfilerInterface @@ -123,39 +127,58 @@ struct _SpProfilerInterface guint *n_pids); }; +SYSPROF_AVAILABLE_IN_ALL void sp_profiler_emit_failed (SpProfiler *self, const GError *error); +SYSPROF_AVAILABLE_IN_ALL void sp_profiler_emit_stopped (SpProfiler *self); +SYSPROF_AVAILABLE_IN_ALL gdouble sp_profiler_get_elapsed (SpProfiler *self); +SYSPROF_AVAILABLE_IN_ALL gboolean sp_profiler_get_is_mutable (SpProfiler *self); +SYSPROF_AVAILABLE_IN_ALL gboolean sp_profiler_get_spawn_inherit_environ (SpProfiler *self); +SYSPROF_AVAILABLE_IN_ALL void sp_profiler_set_spawn_inherit_environ (SpProfiler *self, gboolean spawn_inherit_environ); +SYSPROF_AVAILABLE_IN_ALL gboolean sp_profiler_get_whole_system (SpProfiler *self); +SYSPROF_AVAILABLE_IN_ALL void sp_profiler_set_whole_system (SpProfiler *self, gboolean whole_system); +SYSPROF_AVAILABLE_IN_ALL gboolean sp_profiler_get_spawn (SpProfiler *self); +SYSPROF_AVAILABLE_IN_ALL void sp_profiler_set_spawn (SpProfiler *self, gboolean spawn); +SYSPROF_AVAILABLE_IN_ALL void sp_profiler_set_spawn_argv (SpProfiler *self, const gchar * const *spawn_argv); +SYSPROF_AVAILABLE_IN_ALL void sp_profiler_set_spawn_env (SpProfiler *self, const gchar * const *spawn_env); +SYSPROF_AVAILABLE_IN_ALL void sp_profiler_add_source (SpProfiler *self, SpSource *source); +SYSPROF_AVAILABLE_IN_ALL void sp_profiler_set_writer (SpProfiler *self, SpCaptureWriter *writer); +SYSPROF_AVAILABLE_IN_ALL SpCaptureWriter *sp_profiler_get_writer (SpProfiler *self); +SYSPROF_AVAILABLE_IN_ALL gboolean sp_profiler_get_is_running (SpProfiler *self); +SYSPROF_AVAILABLE_IN_ALL void sp_profiler_start (SpProfiler *self); +SYSPROF_AVAILABLE_IN_ALL void sp_profiler_stop (SpProfiler *self); +SYSPROF_AVAILABLE_IN_ALL void sp_profiler_add_pid (SpProfiler *self, GPid pid); +SYSPROF_AVAILABLE_IN_ALL void sp_profiler_remove_pid (SpProfiler *self, GPid pid); +SYSPROF_AVAILABLE_IN_ALL const GPid *sp_profiler_get_pids (SpProfiler *self, guint *n_pids); G_END_DECLS - -#endif /* SP_PROFILER_H */ diff --git a/src/libsysprof/sp-selection.c b/src/libsysprof/sp-selection.c index af545819..5f7dbad8 100644 --- a/src/libsysprof/sp-selection.c +++ b/src/libsysprof/sp-selection.c @@ -1,6 +1,6 @@ /* sp-selection.c * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,10 +14,14 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ #define G_LOG_DOMAIN "sp-selection" +#include "config.h" + #include "sp-selection.h" struct _SpSelection diff --git a/src/libsysprof/sp-selection.h b/src/libsysprof/sp-selection.h index 4faedbba..a4f50767 100644 --- a/src/libsysprof/sp-selection.h +++ b/src/libsysprof/sp-selection.h @@ -1,6 +1,6 @@ /* sp-selection.h * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,17 +14,21 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ -#ifndef SP_SELECTION_H -#define SP_SELECTION_H +#pragma once #include +#include "sysprof-version-macros.h" + G_BEGIN_DECLS #define SP_TYPE_SELECTION (sp_selection_get_type()) +SYSPROF_AVAILABLE_IN_ALL G_DECLARE_FINAL_TYPE (SpSelection, sp_selection, SP, SELECTION, GObject) typedef void (*SpSelectionForeachFunc) (SpSelection *self, @@ -32,21 +36,26 @@ typedef void (*SpSelectionForeachFunc) (SpSelection *self, gint64 end_time, gpointer user_data); +SYSPROF_AVAILABLE_IN_ALL gboolean sp_selection_get_has_selection (SpSelection *self); +SYSPROF_AVAILABLE_IN_ALL gboolean sp_selection_contains (SpSelection *self, gint64 time_at); +SYSPROF_AVAILABLE_IN_ALL void sp_selection_select_range (SpSelection *self, gint64 begin_time, gint64 end_time); +SYSPROF_AVAILABLE_IN_ALL void sp_selection_unselect_range (SpSelection *self, gint64 begin, gint64 end); +SYSPROF_AVAILABLE_IN_ALL void sp_selection_unselect_all (SpSelection *self); +SYSPROF_AVAILABLE_IN_ALL void sp_selection_foreach (SpSelection *self, SpSelectionForeachFunc foreach_func, gpointer user_data); +SYSPROF_AVAILABLE_IN_ALL SpSelection *sp_selection_copy (const SpSelection *self); G_END_DECLS - -#endif /* SP_SELECTION_H */ diff --git a/src/libsysprof/sp-source-util.c b/src/libsysprof/sp-source-util.c index 8aa792c2..35b92529 100644 --- a/src/libsysprof/sp-source-util.c +++ b/src/libsysprof/sp-source-util.c @@ -18,6 +18,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ +#include "config.h" + #include #include diff --git a/src/libsysprof/sp-source.c b/src/libsysprof/sp-source.c index c03d658b..9feb6063 100644 --- a/src/libsysprof/sp-source.c +++ b/src/libsysprof/sp-source.c @@ -1,6 +1,6 @@ /* sp-source.c * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +14,12 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ +#include "config.h" + #include "sp-source.h" G_DEFINE_INTERFACE (SpSource, sp_source, G_TYPE_OBJECT) diff --git a/src/libsysprof/sp-source.h b/src/libsysprof/sp-source.h index 61498084..839dfb93 100644 --- a/src/libsysprof/sp-source.h +++ b/src/libsysprof/sp-source.h @@ -1,6 +1,6 @@ /* sp-source.h * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,10 +14,11 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ -#ifndef SP_SOURCE_H -#define SP_SOURCE_H +#pragma once #include @@ -129,5 +130,3 @@ void sp_source_start (SpSource *self); void sp_source_stop (SpSource *self); G_END_DECLS - -#endif /* SP_SOURCE_H */ diff --git a/src/libsysprof/sp-symbol-dirs.c b/src/libsysprof/sp-symbol-dirs.c index 90550220..9a9b49eb 100644 --- a/src/libsysprof/sp-symbol-dirs.c +++ b/src/libsysprof/sp-symbol-dirs.c @@ -1,6 +1,6 @@ /* sp-symbol-dirs.c * - * Copyright 2017 Christian Hergert + * Copyright 2017-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,6 +14,8 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ #include "config.h" diff --git a/src/libsysprof/sp-symbol-dirs.h b/src/libsysprof/sp-symbol-dirs.h index 1665e3a2..b7dc479b 100644 --- a/src/libsysprof/sp-symbol-dirs.h +++ b/src/libsysprof/sp-symbol-dirs.h @@ -1,6 +1,6 @@ /* sp-symbol-dirs.h * - * Copyright 2017 Christian Hergert + * Copyright 2017-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,10 +14,11 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ -#ifndef SP_SYMBOL_DIRS_H -#define SP_SYMBOL_DIRS_H +#pragma once #include @@ -29,5 +30,3 @@ gchar **sp_symbol_dirs_get_paths (const gchar *dir, const gchar *name); G_END_DECLS - -#endif /* SP_SYMBOL_DIRS_H */ diff --git a/src/libsysprof/sp-symbol-resolver.c b/src/libsysprof/sp-symbol-resolver.c index bdc647fa..367e5ab6 100644 --- a/src/libsysprof/sp-symbol-resolver.c +++ b/src/libsysprof/sp-symbol-resolver.c @@ -1,6 +1,6 @@ /* sp-symbol-resolver.c * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,8 +14,12 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ +#include "config.h" + #include "sp-symbol-resolver.h" G_DEFINE_INTERFACE (SpSymbolResolver, sp_symbol_resolver, G_TYPE_OBJECT) diff --git a/src/libsysprof/sp-symbol-resolver.h b/src/libsysprof/sp-symbol-resolver.h index 149d954c..a2b47618 100644 --- a/src/libsysprof/sp-symbol-resolver.h +++ b/src/libsysprof/sp-symbol-resolver.h @@ -1,6 +1,6 @@ /* sp-symbol-resolver.h * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -14,10 +14,11 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later */ -#ifndef SP_SYMBOL_RESOLVER_H -#define SP_SYMBOL_RESOLVER_H +#pragma once #include @@ -64,5 +65,3 @@ gchar *sp_symbol_resolver_resolve_with_context (SpSymbolResolver *self, GQuark *tag); G_END_DECLS - -#endif /* SP_SYMBOL_RESOLVER_H */ diff --git a/src/libsysprof/sysprof.h b/src/libsysprof/sysprof.h index 1b762dfb..844c268c 100644 --- a/src/libsysprof/sysprof.h +++ b/src/libsysprof/sysprof.h @@ -1,6 +1,6 @@ /* sysprof.h * - * Copyright 2016 Christian Hergert + * Copyright 2016-2019 Christian Hergert * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/libsysprof/stackstash.c b/src/stackstash.c similarity index 100% rename from src/libsysprof/stackstash.c rename to src/stackstash.c diff --git a/src/libsysprof/stackstash.h b/src/stackstash.h similarity index 100% rename from src/libsysprof/stackstash.h rename to src/stackstash.h