mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-11 23:51:06 +00:00
tracefd: give memfd a descriptive name
This makes it easier to track down from /proc/$pid/fd/.
This commit is contained in:
@ -168,6 +168,7 @@ sysprof_tracefd_source_modify_spawn (SysprofSource *source,
|
|||||||
{
|
{
|
||||||
SysprofTracefdSource *self = (SysprofTracefdSource *)source;
|
SysprofTracefdSource *self = (SysprofTracefdSource *)source;
|
||||||
SysprofTracefdSourcePrivate *priv = sysprof_tracefd_source_get_instance_private (self);
|
SysprofTracefdSourcePrivate *priv = sysprof_tracefd_source_get_instance_private (self);
|
||||||
|
g_autofree gchar *name = NULL;
|
||||||
g_autofree gchar *fdstr = NULL;
|
g_autofree gchar *fdstr = NULL;
|
||||||
gint dest_fd;
|
gint dest_fd;
|
||||||
gint fd;
|
gint fd;
|
||||||
@ -176,7 +177,9 @@ sysprof_tracefd_source_modify_spawn (SysprofSource *source,
|
|||||||
g_assert (SYSPROF_IS_SPAWNABLE (spawnable));
|
g_assert (SYSPROF_IS_SPAWNABLE (spawnable));
|
||||||
g_assert (priv->tracefd == -1);
|
g_assert (priv->tracefd == -1);
|
||||||
|
|
||||||
if (-1 == (fd = sysprof_memfd_create ("[sysprof-proxy-capture]")))
|
name = g_strdup_printf ("[sysprof-tracefd:%s]", priv->envvar);
|
||||||
|
|
||||||
|
if (-1 == (fd = sysprof_memfd_create (name)))
|
||||||
{
|
{
|
||||||
g_warning ("Failed to create FD for tracefd capture: %s",
|
g_warning ("Failed to create FD for tracefd capture: %s",
|
||||||
g_strerror (errno));
|
g_strerror (errno));
|
||||||
|
|||||||
Reference in New Issue
Block a user