mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
libsysprof-analyze: add format helper
This commit is contained in:
@ -151,3 +151,14 @@ sysprof_document_counter_value_get_value_double (SysprofDocumentCounterValue *se
|
|||||||
else
|
else
|
||||||
return (double)self->value.v_int64;
|
return (double)self->value.v_int64;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
sysprof_document_counter_value_format (SysprofDocumentCounterValue *self)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (SYSPROF_IS_DOCUMENT_COUNTER_VALUE (self), NULL);
|
||||||
|
|
||||||
|
if (self->type == SYSPROF_CAPTURE_COUNTER_DOUBLE)
|
||||||
|
return g_strdup_printf ("%lf", self->value.v_double);
|
||||||
|
else
|
||||||
|
return g_strdup_printf ("%ld", self->value.v_int64);
|
||||||
|
}
|
||||||
|
|||||||
@ -32,14 +32,16 @@ SYSPROF_AVAILABLE_IN_ALL
|
|||||||
G_DECLARE_FINAL_TYPE (SysprofDocumentCounterValue, sysprof_document_counter_value, SYSPROF, DOCUMENT_COUNTER_VALUE, GObject)
|
G_DECLARE_FINAL_TYPE (SysprofDocumentCounterValue, sysprof_document_counter_value, SYSPROF, DOCUMENT_COUNTER_VALUE, GObject)
|
||||||
|
|
||||||
SYSPROF_AVAILABLE_IN_ALL
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
gint64 sysprof_document_counter_value_get_time (SysprofDocumentCounterValue *self);
|
gint64 sysprof_document_counter_value_get_time (SysprofDocumentCounterValue *self);
|
||||||
SYSPROF_AVAILABLE_IN_ALL
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
void sysprof_document_counter_value_get_value (SysprofDocumentCounterValue *self,
|
void sysprof_document_counter_value_get_value (SysprofDocumentCounterValue *self,
|
||||||
GValue *value);
|
GValue *value);
|
||||||
SYSPROF_AVAILABLE_IN_ALL
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
gint64 sysprof_document_counter_value_get_value_int64 (SysprofDocumentCounterValue *self);
|
gint64 sysprof_document_counter_value_get_value_int64 (SysprofDocumentCounterValue *self);
|
||||||
SYSPROF_AVAILABLE_IN_ALL
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
double sysprof_document_counter_value_get_value_double (SysprofDocumentCounterValue *self);
|
double sysprof_document_counter_value_get_value_double (SysprofDocumentCounterValue *self);
|
||||||
|
SYSPROF_AVAILABLE_IN_ALL
|
||||||
|
char *sysprof_document_counter_value_format (SysprofDocumentCounterValue *self);
|
||||||
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|||||||
Reference in New Issue
Block a user