mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 08:00:53 +00:00
sysprof: add toggle for hardware information via lspci/lsusb
This commit is contained in:
@ -441,7 +441,7 @@
|
|||||||
<child>
|
<child>
|
||||||
<object class="AdwActionRow">
|
<object class="AdwActionRow">
|
||||||
<property name="activatable-widget">record_graphics_info</property>
|
<property name="activatable-widget">record_graphics_info</property>
|
||||||
<property name="title" translatable="yes">Include Device Information</property>
|
<property name="title" translatable="yes">Include GPU Information</property>
|
||||||
<property name="subtitle" translatable="yes">Records information about graphics hardware and drivers</property>
|
<property name="subtitle" translatable="yes">Records information about graphics hardware and drivers</property>
|
||||||
<child type="suffix">
|
<child type="suffix">
|
||||||
<object class="GtkSwitch" id="record_graphics_info">
|
<object class="GtkSwitch" id="record_graphics_info">
|
||||||
@ -476,7 +476,7 @@
|
|||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="AdwPreferencesGroup">
|
<object class="AdwPreferencesGroup">
|
||||||
<property name="title" translatable="yes">Logging</property>
|
<property name="title" translatable="yes">Details</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="AdwActionRow">
|
<object class="AdwActionRow">
|
||||||
<property name="activatable-widget">record_system_logs</property>
|
<property name="activatable-widget">record_system_logs</property>
|
||||||
@ -492,6 +492,23 @@
|
|||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="AdwPreferencesGroup">
|
||||||
|
<child>
|
||||||
|
<object class="AdwActionRow">
|
||||||
|
<property name="activatable-widget">record_hardware_info</property>
|
||||||
|
<property name="title" translatable="yes">Include Hardware Information</property>
|
||||||
|
<property name="subtitle" translatable="yes">Records information about PCI and USB devices</property>
|
||||||
|
<child type="suffix">
|
||||||
|
<object class="GtkSwitch" id="record_hardware_info">
|
||||||
|
<property name="active" bind-source="recording_template" bind-flags="bidirectional|sync-create" bind-property="hardware-info"/>
|
||||||
|
<property name="valign">center</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="AdwPreferencesGroup">
|
<object class="AdwPreferencesGroup">
|
||||||
<property name="title" translatable="yes">Symbols</property>
|
<property name="title" translatable="yes">Symbols</property>
|
||||||
|
|||||||
@ -39,6 +39,7 @@ struct _SysprofRecordingTemplate
|
|||||||
guint energy_usage : 1;
|
guint energy_usage : 1;
|
||||||
guint frame_timings : 1;
|
guint frame_timings : 1;
|
||||||
guint graphics_info : 1;
|
guint graphics_info : 1;
|
||||||
|
guint hardware_info : 1;
|
||||||
guint javascript_stacks : 1;
|
guint javascript_stacks : 1;
|
||||||
guint memory_allocations : 1;
|
guint memory_allocations : 1;
|
||||||
guint memory_usage : 1;
|
guint memory_usage : 1;
|
||||||
@ -62,6 +63,7 @@ enum {
|
|||||||
PROP_ENVIRON,
|
PROP_ENVIRON,
|
||||||
PROP_FRAME_TIMINGS,
|
PROP_FRAME_TIMINGS,
|
||||||
PROP_GRAPHICS_INFO,
|
PROP_GRAPHICS_INFO,
|
||||||
|
PROP_HARDWARE_INFO,
|
||||||
PROP_JAVASCRIPT_STACKS,
|
PROP_JAVASCRIPT_STACKS,
|
||||||
PROP_MEMORY_ALLOCATIONS,
|
PROP_MEMORY_ALLOCATIONS,
|
||||||
PROP_MEMORY_USAGE,
|
PROP_MEMORY_USAGE,
|
||||||
@ -145,6 +147,10 @@ sysprof_recording_template_get_property (GObject *object,
|
|||||||
g_value_set_boolean (value, self->graphics_info);
|
g_value_set_boolean (value, self->graphics_info);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PROP_HARDWARE_INFO:
|
||||||
|
g_value_set_boolean (value, self->hardware_info);
|
||||||
|
break;
|
||||||
|
|
||||||
case PROP_JAVASCRIPT_STACKS:
|
case PROP_JAVASCRIPT_STACKS:
|
||||||
g_value_set_boolean (value, self->javascript_stacks);
|
g_value_set_boolean (value, self->javascript_stacks);
|
||||||
break;
|
break;
|
||||||
@ -241,6 +247,10 @@ sysprof_recording_template_set_property (GObject *object,
|
|||||||
self->graphics_info = g_value_get_boolean (value);
|
self->graphics_info = g_value_get_boolean (value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PROP_HARDWARE_INFO:
|
||||||
|
self->hardware_info = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
|
|
||||||
case PROP_JAVASCRIPT_STACKS:
|
case PROP_JAVASCRIPT_STACKS:
|
||||||
self->javascript_stacks = g_value_get_boolean (value);
|
self->javascript_stacks = g_value_get_boolean (value);
|
||||||
break;
|
break;
|
||||||
@ -346,6 +356,11 @@ sysprof_recording_template_class_init (SysprofRecordingTemplateClass *klass)
|
|||||||
TRUE,
|
TRUE,
|
||||||
(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
properties[PROP_HARDWARE_INFO] =
|
||||||
|
g_param_spec_boolean ("hardware-info", NULL, NULL,
|
||||||
|
TRUE,
|
||||||
|
(G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
properties[PROP_JAVASCRIPT_STACKS] =
|
properties[PROP_JAVASCRIPT_STACKS] =
|
||||||
g_param_spec_boolean ("javascript-stacks", NULL, NULL,
|
g_param_spec_boolean ("javascript-stacks", NULL, NULL,
|
||||||
FALSE,
|
FALSE,
|
||||||
@ -402,6 +417,7 @@ sysprof_recording_template_init (SysprofRecordingTemplate *self)
|
|||||||
self->disk_usage = TRUE;
|
self->disk_usage = TRUE;
|
||||||
self->frame_timings = TRUE;
|
self->frame_timings = TRUE;
|
||||||
self->graphics_info = TRUE;
|
self->graphics_info = TRUE;
|
||||||
|
self->hardware_info = TRUE;
|
||||||
self->memory_usage = TRUE;
|
self->memory_usage = TRUE;
|
||||||
self->native_stacks = TRUE;
|
self->native_stacks = TRUE;
|
||||||
self->network_usage = TRUE;
|
self->network_usage = TRUE;
|
||||||
@ -554,6 +570,20 @@ sysprof_recording_template_apply (SysprofRecordingTemplate *self,
|
|||||||
NULL));
|
NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (self->hardware_info)
|
||||||
|
{
|
||||||
|
sysprof_profiler_add_instrument (profiler,
|
||||||
|
g_object_new (SYSPROF_TYPE_SUBPROCESS_OUTPUT,
|
||||||
|
"stdout-path", "lsusb",
|
||||||
|
"command-argv", (const char * const[]) {"lsusb", "-v", NULL},
|
||||||
|
NULL));
|
||||||
|
sysprof_profiler_add_instrument (profiler,
|
||||||
|
g_object_new (SYSPROF_TYPE_SUBPROCESS_OUTPUT,
|
||||||
|
"stdout-path", "lspci",
|
||||||
|
"command-argv", (const char * const[]) {"lspci", "-v", NULL},
|
||||||
|
NULL));
|
||||||
|
}
|
||||||
|
|
||||||
if (self->memory_usage)
|
if (self->memory_usage)
|
||||||
sysprof_profiler_add_instrument (profiler, sysprof_memory_usage_new ());
|
sysprof_profiler_add_instrument (profiler, sysprof_memory_usage_new ());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user