mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
Land Sysprof 2.x
This is a major redesign a modernization of Sysprof. The core data structures and design are largely the same, but it has been ported to Gtk3 and has lots of additions that should make your profiling experience smoother. Especially for those that are new to profiling. There are some very simple help docs added, but we really need the experts to come in and write some documentation here.
This commit is contained in:
86
data/Makefile.am
Normal file
86
data/Makefile.am
Normal file
@ -0,0 +1,86 @@
|
||||
SUBDIRS = icons
|
||||
|
||||
mimedir = $(datadir)/mime/packages
|
||||
mime_DATA = sysprof-mime.xml
|
||||
|
||||
desktopdir = $(datadir)/applications
|
||||
desktop_DATA = org.gnome.Sysprof2.desktop
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = sysprof-$(API_VERSION).pc
|
||||
|
||||
gsettings_SCHEMAS = org.gnome.sysprof2.gschema.xml
|
||||
|
||||
.PRECIOUS: $(gsettings_SCHEMAS)
|
||||
|
||||
@GSETTINGS_RULES@
|
||||
|
||||
EXTRA_DIST = \
|
||||
sysprof.pc.in \
|
||||
org.gnome.Sysprof2.desktop \
|
||||
$(mime_DATA) \
|
||||
$(gsettings_SCHEMAS) \
|
||||
$(NULL)
|
||||
|
||||
DISTCLEANFILES = $(pkgconfig_DATA)
|
||||
GITIGNOREFILES = $(dbusservice_DATA)
|
||||
|
||||
|
||||
if ENABLE_SYSPROFD
|
||||
|
||||
dbusservicedir = $(datadir)/dbus-1/system-services
|
||||
dbusservice_in_files = org.gnome.Sysprof2.service.in
|
||||
dbusservice_DATA = $(dbusservice_in_files:.service.in=.service)
|
||||
|
||||
$(dbusservice_DATA): $(dbusservice_in_files) Makefile
|
||||
@sed -e "s|\@sysprofdprivdir\@|$(libexecdir)/$(PACKAGE)|" $< > $@
|
||||
|
||||
dbusconfdir = $(datadir)/dbus-1/system.d
|
||||
dbusconf_in_files = org.gnome.Sysprof2.conf.in
|
||||
dbusconf_DATA = $(dbusconf_in_files:.conf.in=.conf)
|
||||
|
||||
systemdservice_in_files = sysprof2.service.in
|
||||
systemdservicedir = $(systemdsystemunitdir)
|
||||
systemdservice_DATA = $(systemdservice_in_files:.service.in=.service)
|
||||
|
||||
$(systemdservice_DATA): $(systemdservice_in_files) Makefile
|
||||
@sed -e "s|\@sysprofdprivdir\@|$(libexecdir)/$(PACKAGE)|" $< > $@
|
||||
|
||||
polkitdir = $(datadir)/polkit-1/actions
|
||||
polkit_in_files = org.gnome.sysprof2.policy.in
|
||||
polkit_DATA = $(polkit_in_files:.policy.in=.policy)
|
||||
|
||||
DISTCLEANFILES += \
|
||||
$(systemdservice_DATA) \
|
||||
$(dbusservice_DATA) \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_DIST += \
|
||||
org.gnome.Sysprof2.xml \
|
||||
$(dbusservice_in_files) \
|
||||
$(dbusconf_in_files) \
|
||||
$(systemdservice_in_files) \
|
||||
$(polkit_in_files) \
|
||||
$(NULL)
|
||||
|
||||
GITIGNOREFILES += $(systemdservice_DATA)
|
||||
|
||||
endif
|
||||
|
||||
|
||||
install-data-local: install-mimeDATA
|
||||
if [ -f $(DESTDIR)$(datadir)/mime/packages/freedesktop.org.xml ] ; then \
|
||||
if which update-mime-database>/dev/null 2>&1; then \
|
||||
update-mime-database $(DESTDIR)$(datadir)/mime; \
|
||||
fi \
|
||||
fi
|
||||
|
||||
uninstall-local:
|
||||
if [ -f $(DESTDIR)$(datadir)/mime/packages/freedesktop.org.xml ] ; then \
|
||||
if which update-mime-database>/dev/null 2>&1; then \
|
||||
update-mime-database $(DESTDIR)$(datadir)/mime; \
|
||||
fi \
|
||||
fi
|
||||
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
29
data/icons/Makefile.am
Normal file
29
data/icons/Makefile.am
Normal file
@ -0,0 +1,29 @@
|
||||
icondir = $(datadir)/icons/hicolor
|
||||
|
||||
nobase_icon_DATA = \
|
||||
16x16/apps/sysprof.png \
|
||||
24x24/apps/sysprof.png \
|
||||
32x32/apps/sysprof.png \
|
||||
48x48/apps/sysprof.png \
|
||||
256x256/apps/sysprof.png \
|
||||
scalable/apps/sysprof-symbolic.svg \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_DIST = \
|
||||
$(nobase_icon_DATA) \
|
||||
sysprof-source.svg
|
||||
|
||||
gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
|
||||
|
||||
install-data-hook: update-icon-cache
|
||||
uninstall-hook: update-icon-cache
|
||||
update-icon-cache:
|
||||
@-if test -z "$(DESTDIR)"; then \
|
||||
echo "Updating Gtk icon cache."; \
|
||||
$(gtk_update_icon_cache); \
|
||||
else \
|
||||
echo "*** Icon cache not updated. After (un)install, run this:"; \
|
||||
echo "*** $(gtk_update_icon_cache)"; \
|
||||
fi
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
16
data/org.gnome.Sysprof2.conf.in
Normal file
16
data/org.gnome.Sysprof2.conf.in
Normal file
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!DOCTYPE busconfig PUBLIC
|
||||
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
||||
<busconfig>
|
||||
<!-- Only root can own the service -->
|
||||
<policy user="root">
|
||||
<allow own="org.gnome.Sysprof2"/>
|
||||
</policy>
|
||||
|
||||
<!-- Anyone can send messages to the owner of org.gnome.Sysprof2 -->
|
||||
<policy context="default">
|
||||
<allow send_destination="org.gnome.Sysprof2"/>
|
||||
</policy>
|
||||
</busconfig>
|
||||
13
data/org.gnome.Sysprof2.desktop
Normal file
13
data/org.gnome.Sysprof2.desktop
Normal file
@ -0,0 +1,13 @@
|
||||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Name=Sysprof
|
||||
GenericName=Profiler
|
||||
Comment=Profile an application or entire system.
|
||||
Exec=sysprof %u
|
||||
TryExec=sysprof
|
||||
Icon=sysprof
|
||||
StartupNotify=true
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=GNOME;Development;
|
||||
MimeType=application/x-sysprof-capture;
|
||||
5
data/org.gnome.Sysprof2.service.in
Normal file
5
data/org.gnome.Sysprof2.service.in
Normal file
@ -0,0 +1,5 @@
|
||||
[D-BUS Service]
|
||||
Name=org.gnome.Sysprof2
|
||||
Exec=@sysprofdprivdir@/sysprofd
|
||||
User=root
|
||||
SystemdService=sysprof2.service
|
||||
24
data/org.gnome.Sysprof2.xml
Normal file
24
data/org.gnome.Sysprof2.xml
Normal file
@ -0,0 +1,24 @@
|
||||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
||||
<node>
|
||||
<interface name="org.gnome.Sysprof2">
|
||||
<!--
|
||||
PerfEventOpen:
|
||||
@options: key-value pair of attributes for the perf_event_open() syscall.
|
||||
@pid: the process id to monitor, or -1 for system-wide.
|
||||
@cpu: affinity to cpu.
|
||||
@flags: flags for perf_event_open() syscall.
|
||||
@perf_stream_fd: (out): A fd to communicate with perf.
|
||||
|
||||
Performs the perf_event_open() syscall with elevated privileges and passes
|
||||
the resulting fd back to the calling process.
|
||||
-->
|
||||
<method name="PerfEventOpen">
|
||||
<arg name="options" type="a{sv}" direction="in"/>
|
||||
<arg name="pid" type="i" direction="in"/>
|
||||
<arg name="cpu" type="i" direction="in"/>
|
||||
<arg name="flags" type="t" direction="in"/>
|
||||
<arg name="perf_stream_fd" type="h" direction="out"/>
|
||||
</method>
|
||||
</interface>
|
||||
</node>
|
||||
34
data/org.gnome.sysprof2.gschema.xml
Normal file
34
data/org.gnome.sysprof2.gschema.xml
Normal file
@ -0,0 +1,34 @@
|
||||
<schemalist>
|
||||
<schema id="org.gnome.sysprof2" path="/org/gnome/sysprof/" gettext-domain="sysprof">
|
||||
<key name="window-size" type="(ii)">
|
||||
<default>(-1, -1)</default>
|
||||
<summary>Window size</summary>
|
||||
<description>Window size (width and height).</description>
|
||||
</key>
|
||||
<key name="window-position" type="(ii)">
|
||||
<default>(-1,-1)</default>
|
||||
<summary>Window position</summary>
|
||||
<description>Window position (x and y).</description>
|
||||
</key>
|
||||
<key name="window-maximized" type="b">
|
||||
<default>true</default>
|
||||
<summary>Window maximized</summary>
|
||||
<description>Window maximized state</description>
|
||||
</key>
|
||||
<key name="last-spawn-argv" type="s">
|
||||
<default>''</default>
|
||||
<summary>Last Spawn Program</summary>
|
||||
<description>The last spawned program, which will be set in the UI upon restart of the application.</description>
|
||||
</key>
|
||||
<key name="last-spawn-inherit-env" type="b">
|
||||
<default>true</default>
|
||||
<summary>Last Spawn Inherit Environment</summary>
|
||||
<description>If the last spawned environment inherits the parent environment.</description>
|
||||
</key>
|
||||
<key name="last-spawn-env" type="as">
|
||||
<default>[]</default>
|
||||
<summary>Last Spawn Environment</summary>
|
||||
<description>The last spawned environment, which will be set in the UI upon restart of the application.</description>
|
||||
</key>
|
||||
</schema>
|
||||
</schemalist>
|
||||
22
data/org.gnome.sysprof2.policy.in
Normal file
22
data/org.gnome.sysprof2.policy.in
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!DOCTYPE policyconfig PUBLIC
|
||||
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
|
||||
|
||||
<policyconfig>
|
||||
<vendor>The sysprof Project</vendor>
|
||||
<vendor_url>https://wiki.gnome.org/Apps/Sysprof</vendor_url>
|
||||
<icon_name>sysprof</icon_name>
|
||||
|
||||
<action id="org.gnome.sysprof2.perf-event-open">
|
||||
<description>Open a perf event stream</description>
|
||||
<message>Authentication is required to access system performance counters.</message>
|
||||
<defaults>
|
||||
<allow_any>auth_admin_keep</allow_any>
|
||||
<allow_inactive>auth_admin_keep</allow_inactive>
|
||||
<allow_active>auth_admin_keep</allow_active>
|
||||
</defaults>
|
||||
</action>
|
||||
|
||||
</policyconfig>
|
||||
7
data/sysprof-mime.xml
Normal file
7
data/sysprof-mime.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
|
||||
<mime-type type="application/x-sysprof-capture">
|
||||
<comment>Sysprof Capture</comment>
|
||||
<glob pattern="*.syscap"/>
|
||||
</mime-type>
|
||||
</mime-info>
|
||||
11
data/sysprof.pc.in
Normal file
11
data/sysprof.pc.in
Normal file
@ -0,0 +1,11 @@
|
||||
prefix=@prefix@
|
||||
exec_prefix=${prefix}
|
||||
libdir=${exec_prefix}/lib
|
||||
includedir=${exec_prefix}/include
|
||||
|
||||
Name: libsysprof-@API_VERSION@
|
||||
Description: The sysprof library for integrating profiling into IDEs
|
||||
Version: @VERSION@
|
||||
Libs: -L${libdir} -lsysprof-@API_VERSION@
|
||||
Cflags: -I${includedir}/sysprof-@API_VERSION@
|
||||
Requires: gio-2.0 gtk+-3.0
|
||||
8
data/sysprof2.service.in
Normal file
8
data/sysprof2.service.in
Normal file
@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=Sysprof Daemon
|
||||
|
||||
[Service]
|
||||
Type=dbus
|
||||
BusName=org.gnome.Sysprof2
|
||||
ExecStart=@sysprofdprivdir@/sysprofd
|
||||
|
||||
Reference in New Issue
Block a user