mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
sysprof: add dialog to show process information
Includes address layout and mount info for troubleshooting.
This commit is contained in:
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg height="16px" viewBox="0 0 16 16" width="16px" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="m 4 0 c -1.644531 0 -3 1.355469 -3 3 v 10 c 0 1.644531 1.355469 3 3 3 h 8 c 1.644531 0 3 -1.355469 3 -3 v -10 c 0 -1.644531 -1.355469 -3 -3 -3 z m 0 2 h 8 c 0.570312 0 1 0.429688 1 1 v 9 c 0 0.570312 -0.429688 1 -1 1 h -8 c -0.554688 0 -1 -0.445312 -1 -1 v -9 c 0 -0.554688 0.445312 -1 1 -1 z m 1 1 v 1 h -1 v 6 h 2 v 1 h 1 v -1 h 1 v 1 h 1 v -1 h 1 v 1 h 1 v -1 h 1 v -6 h -2 v -1 h -1 v 1 h -1 v -1 h -1 v 1 h -1 v -1 z m 0 0" fill="#2e3436"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 593 B |
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg height="16px" viewBox="0 0 16 16" width="16px" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="m 4 0 c -1.644531 0 -3 1.355469 -3 3 v 10 c 0 1.644531 1.355469 3 3 3 h 8 c 1.644531 0 3 -1.355469 3 -3 v -10 c 0 -1.644531 -1.355469 -3 -3 -3 z m 0 2 h 8 c 0.570312 0 1 0.429688 1 1 v 9 c 0 0.570312 -0.429688 1 -1 1 h -8 c -0.554688 0 -1 -0.445312 -1 -1 v -9 c 0 -0.554688 0.445312 -1 1 -1 z m 4 1 c -2.210938 0 -4 1.789062 -4 4 v 4 h 4 c 2.5 0 4 -1.789062 4 -4 s -1.789062 -4 -4 -4 z m 0 2 c 1.105469 0 2 0.894531 2 2 s -0.894531 2 -2 2 s -2 -0.894531 -2 -2 s 0.894531 -2 2 -2 z m 0 0" fill="#2e3436"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 652 B |
@ -7,6 +7,7 @@ sysprof_sources = [
|
||||
'sysprof-marks-section.c',
|
||||
'sysprof-memory-section.c',
|
||||
'sysprof-metadata-section.c',
|
||||
'sysprof-process-dialog.c',
|
||||
'sysprof-processes-section.c',
|
||||
'sysprof-recording-pad.c',
|
||||
'sysprof-samples-section.c',
|
||||
|
||||
142
src/sysprof/sysprof-process-dialog.c
Normal file
142
src/sysprof/sysprof-process-dialog.c
Normal file
@ -0,0 +1,142 @@
|
||||
/* sysprof-process-dialog.c
|
||||
*
|
||||
* Copyright 2023 Christian Hergert <chergert@redhat.com>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "sysprof-process-dialog.h"
|
||||
|
||||
struct _SysprofProcessDialog
|
||||
{
|
||||
AdwWindow parent_instance;
|
||||
SysprofDocumentProcess *process;
|
||||
};
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
PROP_PROCESS,
|
||||
N_PROPS
|
||||
};
|
||||
|
||||
G_DEFINE_FINAL_TYPE (SysprofProcessDialog, sysprof_process_dialog, ADW_TYPE_WINDOW)
|
||||
|
||||
static GParamSpec *properties [N_PROPS];
|
||||
|
||||
static char *
|
||||
format_address (gpointer unused,
|
||||
SysprofAddress addr)
|
||||
{
|
||||
return g_strdup_printf ("0x%"G_GINT64_MODIFIER"x", addr);
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_process_dialog_dispose (GObject *object)
|
||||
{
|
||||
SysprofProcessDialog *self = (SysprofProcessDialog *)object;
|
||||
|
||||
gtk_widget_dispose_template (GTK_WIDGET (self), SYSPROF_TYPE_PROCESS_DIALOG);
|
||||
|
||||
g_clear_object (&self->process);
|
||||
|
||||
G_OBJECT_CLASS (sysprof_process_dialog_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_process_dialog_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
SysprofProcessDialog *self = SYSPROF_PROCESS_DIALOG (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_PROCESS:
|
||||
g_value_set_object (value, sysprof_process_dialog_get_process (self));
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_process_dialog_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
SysprofProcessDialog *self = SYSPROF_PROCESS_DIALOG (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_PROCESS:
|
||||
sysprof_process_dialog_set_process (self, g_value_get_object (value));
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_process_dialog_class_init (SysprofProcessDialogClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||
|
||||
object_class->dispose = sysprof_process_dialog_dispose;
|
||||
object_class->get_property = sysprof_process_dialog_get_property;
|
||||
object_class->set_property = sysprof_process_dialog_set_property;
|
||||
|
||||
properties [PROP_PROCESS] =
|
||||
g_param_spec_object ("process", NULL, NULL,
|
||||
SYSPROF_TYPE_DOCUMENT_PROCESS,
|
||||
(G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
g_object_class_install_properties (object_class, N_PROPS, properties);
|
||||
|
||||
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/sysprof/sysprof-process-dialog.ui");
|
||||
gtk_widget_class_bind_template_callback (widget_class, format_address);
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_process_dialog_init (SysprofProcessDialog *self)
|
||||
{
|
||||
gtk_widget_init_template (GTK_WIDGET (self));
|
||||
}
|
||||
|
||||
SysprofDocumentProcess *
|
||||
sysprof_process_dialog_get_process (SysprofProcessDialog *self)
|
||||
{
|
||||
g_return_val_if_fail (SYSPROF_IS_PROCESS_DIALOG (self), NULL);
|
||||
|
||||
return self->process;
|
||||
}
|
||||
|
||||
void
|
||||
sysprof_process_dialog_set_process (SysprofProcessDialog *self,
|
||||
SysprofDocumentProcess *process)
|
||||
{
|
||||
g_return_if_fail (SYSPROF_IS_PROCESS_DIALOG (self));
|
||||
g_return_if_fail (!process || SYSPROF_IS_DOCUMENT_PROCESS (process));
|
||||
|
||||
if (g_set_object (&self->process, process))
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_PROCESS]);
|
||||
}
|
||||
37
src/sysprof/sysprof-process-dialog.h
Normal file
37
src/sysprof/sysprof-process-dialog.h
Normal file
@ -0,0 +1,37 @@
|
||||
/* sysprof-process-dialog.h
|
||||
*
|
||||
* Copyright 2023 Christian Hergert <chergert@redhat.com>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <adwaita.h>
|
||||
|
||||
#include <sysprof-analyze.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define SYSPROF_TYPE_PROCESS_DIALOG (sysprof_process_dialog_get_type())
|
||||
|
||||
G_DECLARE_FINAL_TYPE (SysprofProcessDialog, sysprof_process_dialog, SYSPROF, PROCESS_DIALOG, AdwWindow)
|
||||
|
||||
SysprofDocumentProcess *sysprof_process_dialog_get_process (SysprofProcessDialog *self);
|
||||
void sysprof_process_dialog_set_process (SysprofProcessDialog *self,
|
||||
SysprofDocumentProcess *process);
|
||||
|
||||
G_END_DECLS
|
||||
572
src/sysprof/sysprof-process-dialog.ui
Normal file
572
src/sysprof/sysprof-process-dialog.ui
Normal file
@ -0,0 +1,572 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="SysprofProcessDialog" parent="AdwWindow">
|
||||
<property name="default-width">800</property>
|
||||
<property name="default-height">600</property>
|
||||
<property name="content">
|
||||
<object class="AdwToolbarView">
|
||||
<child type="top">
|
||||
<object class="AdwHeaderBar">
|
||||
<property name="title-widget">
|
||||
<object class="AdwWindowTitle">
|
||||
<binding name="title">
|
||||
<lookup name="pid" type="SysprofDocumentProcess">
|
||||
<lookup name="process">SysprofProcessDialog</lookup>
|
||||
</lookup>
|
||||
</binding>
|
||||
<binding name="subtitle">
|
||||
<lookup name="command-line" type="SysprofDocumentProcess">
|
||||
<lookup name="process">SysprofProcessDialog</lookup>
|
||||
</lookup>
|
||||
</binding>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<property name="content">
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="AdwViewStack" id="view_stack">
|
||||
<property name="vexpand">true</property>
|
||||
<child>
|
||||
<object class="AdwViewStackPage">
|
||||
<property name="icon-name">address-layout-symbolic</property>
|
||||
<property name="title" translatable="yes">Address Layout</property>
|
||||
<property name="child">
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="vexpand">true</property>
|
||||
<child>
|
||||
<object class="GtkColumnView" id="column_view">
|
||||
<property name="show-column-separators">true</property>
|
||||
<property name="show-row-separators">true</property>
|
||||
<style>
|
||||
<class name="data-table"/>
|
||||
</style>
|
||||
<property name="model">
|
||||
<object class="GtkMultiSelection">
|
||||
<property name="model">
|
||||
<object class="GtkSortListModel">
|
||||
<binding name="sorter">
|
||||
<lookup name="sorter">column_view</lookup>
|
||||
</binding>
|
||||
<binding name="model">
|
||||
<lookup name="memory-maps" type="SysprofDocumentProcess">
|
||||
<lookup name="process">SysprofProcessDialog</lookup>
|
||||
</lookup>
|
||||
</binding>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
<child>
|
||||
<object class="GtkColumnViewColumn" id="time_column">
|
||||
<property name="title" translatable="yes">Time</property>
|
||||
<property name="sorter">
|
||||
<object class="GtkNumericSorter">
|
||||
<property name="expression">
|
||||
<lookup name="time" type="SysprofDocumentMmap"/>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
<property name="factory">
|
||||
<object class="GtkBuilderListItemFactory">
|
||||
<property name="bytes"><![CDATA[
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GtkListItem">
|
||||
<property name="child">
|
||||
<object class="SysprofTimeLabel">
|
||||
<binding name="time-offset">
|
||||
<lookup name="time-offset" type="SysprofDocumentMmap">
|
||||
<lookup name="item">GtkListItem</lookup>
|
||||
</lookup>
|
||||
</binding>
|
||||
</object>
|
||||
</property>
|
||||
</template>
|
||||
</interface>
|
||||
]]>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColumnViewColumn" id="start_address_column">
|
||||
<property name="title" translatable="yes">Start Address</property>
|
||||
<property name="sorter">
|
||||
<object class="GtkNumericSorter">
|
||||
<property name="expression">
|
||||
<lookup name="start-address" type="SysprofDocumentMmap"/>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
<property name="factory">
|
||||
<object class="GtkBuilderListItemFactory">
|
||||
<property name="bytes"><![CDATA[
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GtkListItem">
|
||||
<property name="child">
|
||||
<object class="GtkLabel">
|
||||
<property name="xalign">0</property>
|
||||
<attributes>
|
||||
<attribute name="family" value="monospace"/>
|
||||
<attribute name="font-features" value="'tnum'"/>
|
||||
</attributes>
|
||||
<binding name="label">
|
||||
<closure type="gchararray" function="format_address">
|
||||
<lookup name="start-address" type="SysprofDocumentMmap">
|
||||
<lookup name="item">GtkListItem</lookup>
|
||||
</lookup>
|
||||
</closure>
|
||||
</binding>
|
||||
</object>
|
||||
</property>
|
||||
</template>
|
||||
</interface>
|
||||
]]>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColumnViewColumn" id="end_address_column">
|
||||
<property name="title" translatable="yes">End Address</property>
|
||||
<property name="sorter">
|
||||
<object class="GtkNumericSorter">
|
||||
<property name="expression">
|
||||
<lookup name="end-address" type="SysprofDocumentMmap"/>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
<property name="factory">
|
||||
<object class="GtkBuilderListItemFactory">
|
||||
<property name="bytes"><![CDATA[
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GtkListItem">
|
||||
<property name="child">
|
||||
<object class="GtkLabel">
|
||||
<property name="xalign">0</property>
|
||||
<attributes>
|
||||
<attribute name="family" value="monospace"/>
|
||||
<attribute name="font-features" value="'tnum'"/>
|
||||
</attributes>
|
||||
<binding name="label">
|
||||
<closure type="gchararray" function="format_address">
|
||||
<lookup name="end-address" type="SysprofDocumentMmap">
|
||||
<lookup name="item">GtkListItem</lookup>
|
||||
</lookup>
|
||||
</closure>
|
||||
</binding>
|
||||
</object>
|
||||
</property>
|
||||
</template>
|
||||
</interface>
|
||||
]]>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColumnViewColumn" id="file_column">
|
||||
<property name="title" translatable="yes">File</property>
|
||||
<property name="expand">true</property>
|
||||
<property name="sorter">
|
||||
<object class="GtkStringSorter">
|
||||
<property name="expression">
|
||||
<lookup name="file" type="SysprofDocumentMmap"/>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
<property name="factory">
|
||||
<object class="GtkBuilderListItemFactory">
|
||||
<property name="bytes"><![CDATA[
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GtkListItem">
|
||||
<property name="child">
|
||||
<object class="GtkLabel">
|
||||
<property name="xalign">0</property>
|
||||
<binding name="label">
|
||||
<lookup name="file" type="SysprofDocumentMmap">
|
||||
<lookup name="item">GtkListItem</lookup>
|
||||
</lookup>
|
||||
</binding>
|
||||
</object>
|
||||
</property>
|
||||
</template>
|
||||
</interface>
|
||||
]]>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="AdwViewStackPage">
|
||||
<property name="icon-name">process-mounts-symbolic</property>
|
||||
<property name="title" translatable="yes">Mounts</property>
|
||||
<property name="child">
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="vexpand">true</property>
|
||||
<child>
|
||||
<object class="GtkColumnView" id="mounts_column_view">
|
||||
<property name="show-column-separators">true</property>
|
||||
<property name="show-row-separators">true</property>
|
||||
<style>
|
||||
<class name="data-table"/>
|
||||
</style>
|
||||
<property name="model">
|
||||
<object class="GtkMultiSelection">
|
||||
<property name="model">
|
||||
<object class="GtkSortListModel">
|
||||
<binding name="sorter">
|
||||
<lookup name="sorter">mounts_column_view</lookup>
|
||||
</binding>
|
||||
<binding name="model">
|
||||
<lookup name="mounts" type="SysprofDocumentProcess">
|
||||
<lookup name="process">SysprofProcessDialog</lookup>
|
||||
</lookup>
|
||||
</binding>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
<child>
|
||||
<object class="GtkColumnViewColumn">
|
||||
<property name="title" translatable="yes">ID</property>
|
||||
<property name="sorter">
|
||||
<object class="GtkNumericSorter">
|
||||
<property name="expression">
|
||||
<lookup name="mount-id" type="SysprofMount"/>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
<property name="factory">
|
||||
<object class="GtkBuilderListItemFactory">
|
||||
<property name="bytes"><![CDATA[
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GtkListItem">
|
||||
<property name="child">
|
||||
<object class="GtkInscription">
|
||||
<property name="nat-chars">2</property>
|
||||
<binding name="text">
|
||||
<lookup name="mount-id" type="SysprofMount">
|
||||
<lookup name="item">GtkListItem</lookup>
|
||||
</lookup>
|
||||
</binding>
|
||||
</object>
|
||||
</property>
|
||||
</template>
|
||||
</interface>
|
||||
]]>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColumnViewColumn">
|
||||
<property name="title" translatable="yes">Parent</property>
|
||||
<property name="sorter">
|
||||
<object class="GtkNumericSorter">
|
||||
<property name="expression">
|
||||
<lookup name="parent-mount-id" type="SysprofMount"/>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
<property name="factory">
|
||||
<object class="GtkBuilderListItemFactory">
|
||||
<property name="bytes"><![CDATA[
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GtkListItem">
|
||||
<property name="child">
|
||||
<object class="GtkInscription">
|
||||
<property name="nat-chars">2</property>
|
||||
<binding name="text">
|
||||
<lookup name="parent-mount-id" type="SysprofMount">
|
||||
<lookup name="item">GtkListItem</lookup>
|
||||
</lookup>
|
||||
</binding>
|
||||
</object>
|
||||
</property>
|
||||
</template>
|
||||
</interface>
|
||||
]]>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColumnViewColumn">
|
||||
<property name="title" translatable="yes">Major</property>
|
||||
<property name="sorter">
|
||||
<object class="GtkNumericSorter">
|
||||
<property name="expression">
|
||||
<lookup name="device-major" type="SysprofMount"/>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
<property name="factory">
|
||||
<object class="GtkBuilderListItemFactory">
|
||||
<property name="bytes"><![CDATA[
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GtkListItem">
|
||||
<property name="child">
|
||||
<object class="GtkInscription">
|
||||
<property name="nat-chars">2</property>
|
||||
<binding name="text">
|
||||
<lookup name="device-major" type="SysprofMount">
|
||||
<lookup name="item">GtkListItem</lookup>
|
||||
</lookup>
|
||||
</binding>
|
||||
</object>
|
||||
</property>
|
||||
</template>
|
||||
</interface>
|
||||
]]>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColumnViewColumn">
|
||||
<property name="title" translatable="yes">Minor</property>
|
||||
<property name="sorter">
|
||||
<object class="GtkNumericSorter">
|
||||
<property name="expression">
|
||||
<lookup name="device-minor" type="SysprofMount"/>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
<property name="factory">
|
||||
<object class="GtkBuilderListItemFactory">
|
||||
<property name="bytes"><![CDATA[
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GtkListItem">
|
||||
<property name="child">
|
||||
<object class="GtkInscription">
|
||||
<property name="nat-chars">2</property>
|
||||
<binding name="text">
|
||||
<lookup name="device-minor" type="SysprofMount">
|
||||
<lookup name="item">GtkListItem</lookup>
|
||||
</lookup>
|
||||
</binding>
|
||||
</object>
|
||||
</property>
|
||||
</template>
|
||||
</interface>
|
||||
]]>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColumnViewColumn">
|
||||
<property name="title" translatable="yes">Mount Point</property>
|
||||
<property name="sorter">
|
||||
<object class="GtkStringSorter">
|
||||
<property name="expression">
|
||||
<lookup name="mount-point" type="SysprofMount"/>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
<property name="factory">
|
||||
<object class="GtkBuilderListItemFactory">
|
||||
<property name="bytes"><![CDATA[
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GtkListItem">
|
||||
<property name="child">
|
||||
<object class="GtkLabel">
|
||||
<property name="xalign">0</property>
|
||||
<binding name="label">
|
||||
<lookup name="mount-point" type="SysprofMount">
|
||||
<lookup name="item">GtkListItem</lookup>
|
||||
</lookup>
|
||||
</binding>
|
||||
</object>
|
||||
</property>
|
||||
</template>
|
||||
</interface>
|
||||
]]>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColumnViewColumn">
|
||||
<property name="title" translatable="yes">Mount Source</property>
|
||||
<property name="sorter">
|
||||
<object class="GtkStringSorter">
|
||||
<property name="expression">
|
||||
<lookup name="mount-source" type="SysprofMount"/>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
<property name="factory">
|
||||
<object class="GtkBuilderListItemFactory">
|
||||
<property name="bytes"><![CDATA[
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GtkListItem">
|
||||
<property name="child">
|
||||
<object class="GtkLabel">
|
||||
<property name="xalign">0</property>
|
||||
<binding name="label">
|
||||
<lookup name="mount-source" type="SysprofMount">
|
||||
<lookup name="item">GtkListItem</lookup>
|
||||
</lookup>
|
||||
</binding>
|
||||
</object>
|
||||
</property>
|
||||
</template>
|
||||
</interface>
|
||||
]]>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColumnViewColumn">
|
||||
<property name="title" translatable="yes">Root</property>
|
||||
<property name="sorter">
|
||||
<object class="GtkStringSorter">
|
||||
<property name="expression">
|
||||
<lookup name="root" type="SysprofMount"/>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
<property name="factory">
|
||||
<object class="GtkBuilderListItemFactory">
|
||||
<property name="bytes"><![CDATA[
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GtkListItem">
|
||||
<property name="child">
|
||||
<object class="GtkLabel">
|
||||
<property name="xalign">0</property>
|
||||
<binding name="label">
|
||||
<lookup name="root" type="SysprofMount">
|
||||
<lookup name="item">GtkListItem</lookup>
|
||||
</lookup>
|
||||
</binding>
|
||||
</object>
|
||||
</property>
|
||||
</template>
|
||||
</interface>
|
||||
]]>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColumnViewColumn">
|
||||
<property name="title" translatable="yes">Filesystem</property>
|
||||
<property name="sorter">
|
||||
<object class="GtkStringSorter">
|
||||
<property name="expression">
|
||||
<lookup name="filesystem-type" type="SysprofMount"/>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
<property name="factory">
|
||||
<object class="GtkBuilderListItemFactory">
|
||||
<property name="bytes"><![CDATA[
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GtkListItem">
|
||||
<property name="child">
|
||||
<object class="GtkLabel">
|
||||
<property name="xalign">0</property>
|
||||
<binding name="label">
|
||||
<lookup name="filesystem-type" type="SysprofMount">
|
||||
<lookup name="item">GtkListItem</lookup>
|
||||
</lookup>
|
||||
</binding>
|
||||
</object>
|
||||
</property>
|
||||
</template>
|
||||
</interface>
|
||||
]]>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColumnViewColumn">
|
||||
<property name="title" translatable="yes">Options</property>
|
||||
<property name="expand">true</property>
|
||||
<property name="sorter">
|
||||
<object class="GtkStringSorter">
|
||||
<property name="expression">
|
||||
<lookup name="superblock-options" type="SysprofMount"/>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
<property name="factory">
|
||||
<object class="GtkBuilderListItemFactory">
|
||||
<property name="bytes"><![CDATA[
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GtkListItem">
|
||||
<property name="child">
|
||||
<object class="GtkLabel">
|
||||
<property name="xalign">0</property>
|
||||
<binding name="label">
|
||||
<lookup name="superblock-options" type="SysprofMount">
|
||||
<lookup name="item">GtkListItem</lookup>
|
||||
</lookup>
|
||||
</binding>
|
||||
</object>
|
||||
</property>
|
||||
</template>
|
||||
</interface>
|
||||
]]>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="AdwViewSwitcherBar">
|
||||
<property name="stack">view_stack</property>
|
||||
<property name="reveal">true</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</template>
|
||||
</interface>
|
||||
@ -25,6 +25,7 @@
|
||||
#include <adwaita.h>
|
||||
#include <sysprof-gtk.h>
|
||||
|
||||
#include "sysprof-process-dialog.h"
|
||||
#include "sysprof-processes-section.h"
|
||||
#include "sysprof-single-model.h"
|
||||
|
||||
@ -37,6 +38,31 @@ struct _SysprofProcessesSection
|
||||
|
||||
G_DEFINE_FINAL_TYPE (SysprofProcessesSection, sysprof_processes_section, SYSPROF_TYPE_SECTION)
|
||||
|
||||
static void
|
||||
activate_layer_item_cb (GtkListItem *list_item,
|
||||
SysprofChartLayer *layer,
|
||||
SysprofDocumentProcess *process,
|
||||
SysprofChart *chart)
|
||||
{
|
||||
SysprofProcessDialog *dialog;
|
||||
g_autofree char *title = NULL;
|
||||
|
||||
g_assert (GTK_IS_LIST_ITEM (list_item));
|
||||
g_assert (SYSPROF_IS_CHART_LAYER (layer));
|
||||
g_assert (SYSPROF_IS_DOCUMENT_PROCESS (process));
|
||||
g_assert (SYSPROF_IS_CHART (chart));
|
||||
|
||||
title = sysprof_document_process_dup_title (process);
|
||||
|
||||
dialog = g_object_new (SYSPROF_TYPE_PROCESS_DIALOG,
|
||||
"process", process,
|
||||
"transient-for", gtk_widget_get_root (GTK_WIDGET (chart)),
|
||||
"title", title,
|
||||
NULL);
|
||||
|
||||
gtk_window_present (GTK_WINDOW (dialog));
|
||||
}
|
||||
|
||||
static void
|
||||
sysprof_processes_section_dispose (GObject *object)
|
||||
{
|
||||
@ -57,6 +83,7 @@ sysprof_processes_section_class_init (SysprofProcessesSectionClass *klass)
|
||||
|
||||
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/sysprof/sysprof-processes-section.ui");
|
||||
gtk_widget_class_bind_template_child (widget_class, SysprofProcessesSection, list_view);
|
||||
gtk_widget_class_bind_template_callback (widget_class, activate_layer_item_cb);
|
||||
|
||||
g_type_ensure (SYSPROF_TYPE_CHART);
|
||||
g_type_ensure (SYSPROF_TYPE_CHART_LAYER);
|
||||
|
||||
@ -42,6 +42,7 @@
|
||||
<property name="height-request">16</property>
|
||||
<child>
|
||||
<object class="SysprofChart">
|
||||
<signal name="activate-layer-item" handler="activate_layer_item_cb" swapped="true"/>
|
||||
<property name="hexpand">true</property>
|
||||
<child>
|
||||
<object class="SysprofTimeSpanLayer">
|
||||
|
||||
@ -9,15 +9,18 @@
|
||||
<file preprocess="xml-stripblanks">sysprof-marks-section.ui</file>
|
||||
<file preprocess="xml-stripblanks">sysprof-memory-section.ui</file>
|
||||
<file preprocess="xml-stripblanks">sysprof-metadata-section.ui</file>
|
||||
<file preprocess="xml-stripblanks">sysprof-process-dialog.ui</file>
|
||||
<file preprocess="xml-stripblanks">sysprof-processes-section.ui</file>
|
||||
<file preprocess="xml-stripblanks">sysprof-recording-pad.ui</file>
|
||||
<file preprocess="xml-stripblanks">sysprof-samples-section.ui</file>
|
||||
<file preprocess="xml-stripblanks">sysprof-sidebar.ui</file>
|
||||
<file preprocess="xml-stripblanks">sysprof-window.ui</file>
|
||||
<file preprocess="xml-stripblanks">icons/scalable/actions/address-layout-symbolic.svg</file>
|
||||
<file preprocess="xml-stripblanks">icons/scalable/actions/mark-chart-symbolic.svg</file>
|
||||
<file preprocess="xml-stripblanks">icons/scalable/actions/mark-table-symbolic.svg</file>
|
||||
<file preprocess="xml-stripblanks">icons/scalable/actions/memory-allocations-symbolic.svg</file>
|
||||
<file preprocess="xml-stripblanks">icons/scalable/actions/metadata-symbolic.svg</file>
|
||||
<file preprocess="xml-stripblanks">icons/scalable/actions/process-mounts-symbolic.svg</file>
|
||||
<file preprocess="xml-stripblanks">icons/scalable/actions/system-log-symbolic.svg</file>
|
||||
</gresource>
|
||||
</gresources>
|
||||
|
||||
Reference in New Issue
Block a user