mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
Fix -Werror=literal-suffix
When trying to build gjs with --werror, I get the following error: In file included from /nix/store/snc19nr462570ssx03v455p164vyz15s-sysprof-3.36.0-dev/include/sysprof-3/sysprof-capture-condition.h:59, from /nix/store/snc19nr462570ssx03v455p164vyz15s-sysprof-3.36.0-dev/include/sysprof-3/sysprof-capture.h:66, from ../gjs/profiler.cpp:53: /nix/store/snc19nr462570ssx03v455p164vyz15s-sysprof-3.36.0-dev/include/sysprof-3/sysprof-capture-types.h:76:40: error: invalid suffix on literal; C++11 requires a space between literal and string macro [-Werror=literal-suffix] 76 | #define SYSPROF_CAPTURE_ADDRESS_FORMAT "0x%016"G_GINT64_MODIFIER"x" | ^ cc1plus: all warnings being treated as errors
This commit is contained in:
@ -73,7 +73,7 @@ G_BEGIN_DECLS
|
|||||||
# define SYSPROF_ALIGNED_END(_N) __attribute__((aligned ((_N))))
|
# define SYSPROF_ALIGNED_END(_N) __attribute__((aligned ((_N))))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SYSPROF_CAPTURE_ADDRESS_FORMAT "0x%016"G_GINT64_MODIFIER"x"
|
#define SYSPROF_CAPTURE_ADDRESS_FORMAT "0x%016" G_GINT64_MODIFIER "x"
|
||||||
|
|
||||||
#if GLIB_SIZEOF_VOID_P == 8
|
#if GLIB_SIZEOF_VOID_P == 8
|
||||||
# define SYSPROF_CAPTURE_JITMAP_MARK G_GUINT64_CONSTANT(0xE000000000000000)
|
# define SYSPROF_CAPTURE_JITMAP_MARK G_GUINT64_CONSTANT(0xE000000000000000)
|
||||||
|
|||||||
@ -83,7 +83,7 @@ main (gint argc,
|
|||||||
begin_time = sysprof_capture_reader_get_start_time (reader);
|
begin_time = sysprof_capture_reader_get_start_time (reader);
|
||||||
end_time = sysprof_capture_reader_get_end_time (reader);
|
end_time = sysprof_capture_reader_get_end_time (reader);
|
||||||
|
|
||||||
g_print ("Capture Time Range: %"G_GUINT64_FORMAT" to %"G_GUINT64_FORMAT" (%lf)\n",
|
g_print ("Capture Time Range: %" G_GUINT64_FORMAT " to %" G_GUINT64_FORMAT " (%lf)\n",
|
||||||
begin_time, end_time, (end_time - begin_time) / (gdouble)SYSPROF_NSEC_PER_SEC);
|
begin_time, end_time, (end_time - begin_time) / (gdouble)SYSPROF_NSEC_PER_SEC);
|
||||||
|
|
||||||
while (sysprof_capture_reader_peek_type (reader, &type))
|
while (sysprof_capture_reader_peek_type (reader, &type))
|
||||||
@ -128,7 +128,7 @@ main (gint argc,
|
|||||||
|
|
||||||
g_hash_table_iter_init (&iter, ret);
|
g_hash_table_iter_init (&iter, ret);
|
||||||
while (g_hash_table_iter_next (&iter, (gpointer *)&addr, (gpointer *)&str))
|
while (g_hash_table_iter_next (&iter, (gpointer *)&addr, (gpointer *)&str))
|
||||||
g_print (" "SYSPROF_CAPTURE_ADDRESS_FORMAT" : %s\n", addr, str);
|
g_print (" " SYSPROF_CAPTURE_ADDRESS_FORMAT " : %s\n", addr, str);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -138,7 +138,7 @@ main (gint argc,
|
|||||||
const SysprofCaptureLog *log = sysprof_capture_reader_read_log (reader);
|
const SysprofCaptureLog *log = sysprof_capture_reader_read_log (reader);
|
||||||
gdouble ptime = (log->frame.time - begin_time) / (gdouble)SYSPROF_NSEC_PER_SEC;
|
gdouble ptime = (log->frame.time - begin_time) / (gdouble)SYSPROF_NSEC_PER_SEC;
|
||||||
|
|
||||||
g_print ("LOG: pid=%d time=%"G_GINT64_FORMAT" (%lf)\n"
|
g_print ("LOG: pid=%d time=%" G_GINT64_FORMAT " (%lf)\n"
|
||||||
" severity = %d\n"
|
" severity = %d\n"
|
||||||
" domain = %s\n"
|
" domain = %s\n"
|
||||||
" message = %s\n",
|
" message = %s\n",
|
||||||
@ -152,11 +152,11 @@ main (gint argc,
|
|||||||
{
|
{
|
||||||
const SysprofCaptureMap *map = sysprof_capture_reader_read_map (reader);
|
const SysprofCaptureMap *map = sysprof_capture_reader_read_map (reader);
|
||||||
|
|
||||||
g_print ("MAP: pid=%d time=%"G_GINT64_FORMAT"\n"
|
g_print ("MAP: pid=%d time=%" G_GINT64_FORMAT "\n"
|
||||||
" start = %"G_GUINT64_FORMAT"\n"
|
" start = %" G_GUINT64_FORMAT "\n"
|
||||||
" end = %"G_GUINT64_FORMAT"\n"
|
" end = %" G_GUINT64_FORMAT "\n"
|
||||||
" offset = %"G_GUINT64_FORMAT"\n"
|
" offset = %" G_GUINT64_FORMAT "\n"
|
||||||
" inode = %"G_GUINT64_FORMAT"\n"
|
" inode = %" G_GUINT64_FORMAT "\n"
|
||||||
" filename = %s\n",
|
" filename = %s\n",
|
||||||
map->frame.pid, map->frame.time,
|
map->frame.pid, map->frame.time,
|
||||||
map->start, map->end, map->offset, map->inode, map->filename);
|
map->start, map->end, map->offset, map->inode, map->filename);
|
||||||
@ -169,7 +169,7 @@ main (gint argc,
|
|||||||
const SysprofCaptureFileChunk *file_chunk = sysprof_capture_reader_read_file (reader);
|
const SysprofCaptureFileChunk *file_chunk = sysprof_capture_reader_read_file (reader);
|
||||||
gdouble ptime = (file_chunk->frame.time - begin_time) / (gdouble)SYSPROF_NSEC_PER_SEC;
|
gdouble ptime = (file_chunk->frame.time - begin_time) / (gdouble)SYSPROF_NSEC_PER_SEC;
|
||||||
|
|
||||||
g_print ("FILE_CHUNK: pid=%d time=%"G_GINT64_FORMAT" (%lf)\n"
|
g_print ("FILE_CHUNK: pid=%d time=%" G_GINT64_FORMAT " (%lf)\n"
|
||||||
" path = %s\n"
|
" path = %s\n"
|
||||||
" is_last = %d\n"
|
" is_last = %d\n"
|
||||||
" bytes = %d\n",
|
" bytes = %d\n",
|
||||||
@ -184,10 +184,10 @@ main (gint argc,
|
|||||||
const SysprofCaptureMark *mark = sysprof_capture_reader_read_mark (reader);
|
const SysprofCaptureMark *mark = sysprof_capture_reader_read_mark (reader);
|
||||||
gdouble ptime = (mark->frame.time - begin_time) / (gdouble)SYSPROF_NSEC_PER_SEC;
|
gdouble ptime = (mark->frame.time - begin_time) / (gdouble)SYSPROF_NSEC_PER_SEC;
|
||||||
|
|
||||||
g_print ("MARK: pid=%d time=%"G_GINT64_FORMAT" (%lf)\n"
|
g_print ("MARK: pid=%d time=%" G_GINT64_FORMAT " (%lf)\n"
|
||||||
" group = %s\n"
|
" group = %s\n"
|
||||||
" name = %s\n"
|
" name = %s\n"
|
||||||
" duration = %"G_GUINT64_FORMAT"\n"
|
" duration = %" G_GUINT64_FORMAT "\n"
|
||||||
" message = %s\n",
|
" message = %s\n",
|
||||||
mark->frame.pid, mark->frame.time, ptime,
|
mark->frame.pid, mark->frame.time, ptime,
|
||||||
mark->group, mark->name, mark->duration, mark->message);
|
mark->group, mark->name, mark->duration, mark->message);
|
||||||
@ -200,7 +200,7 @@ main (gint argc,
|
|||||||
const SysprofCaptureMetadata *metadata = sysprof_capture_reader_read_metadata (reader);
|
const SysprofCaptureMetadata *metadata = sysprof_capture_reader_read_metadata (reader);
|
||||||
gdouble ptime = (metadata->frame.time - begin_time) / (gdouble)SYSPROF_NSEC_PER_SEC;
|
gdouble ptime = (metadata->frame.time - begin_time) / (gdouble)SYSPROF_NSEC_PER_SEC;
|
||||||
|
|
||||||
g_print ("METADATA: pid=%d time=%"G_GINT64_FORMAT" (%lf)\n"
|
g_print ("METADATA: pid=%d time=%" G_GINT64_FORMAT " (%lf)\n"
|
||||||
" id = %s\n"
|
" id = %s\n"
|
||||||
"\"\"\"\n%s\n\"\"\"\n",
|
"\"\"\"\n%s\n\"\"\"\n",
|
||||||
metadata->frame.pid, metadata->frame.time, ptime,
|
metadata->frame.pid, metadata->frame.time, ptime,
|
||||||
@ -216,7 +216,7 @@ main (gint argc,
|
|||||||
if (pr == NULL)
|
if (pr == NULL)
|
||||||
perror ("Failed to read process");
|
perror ("Failed to read process");
|
||||||
|
|
||||||
g_print ("PROCESS: pid=%d cmdline=%s time=%"G_GINT64_FORMAT"\n", pr->frame.pid, pr->cmdline, pr->frame.time);
|
g_print ("PROCESS: pid=%d cmdline=%s time=%" G_GINT64_FORMAT "\n", pr->frame.pid, pr->cmdline, pr->frame.time);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -227,10 +227,10 @@ main (gint argc,
|
|||||||
gdouble ptime = (s->frame.time - begin_time) / (gdouble)SYSPROF_NSEC_PER_SEC;
|
gdouble ptime = (s->frame.time - begin_time) / (gdouble)SYSPROF_NSEC_PER_SEC;
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
g_print ("SAMPLE: pid=%d time=%"G_GINT64_FORMAT" (%lf)\n", s->frame.pid, s->frame.time, ptime);
|
g_print ("SAMPLE: pid=%d time=%" G_GINT64_FORMAT " (%lf)\n", s->frame.pid, s->frame.time, ptime);
|
||||||
|
|
||||||
for (i = 0; i < s->n_addrs; i++)
|
for (i = 0; i < s->n_addrs; i++)
|
||||||
g_print (" "SYSPROF_CAPTURE_ADDRESS_FORMAT"\n", s->addrs[i]);
|
g_print (" " SYSPROF_CAPTURE_ADDRESS_FORMAT "\n", s->addrs[i]);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -238,7 +238,7 @@ main (gint argc,
|
|||||||
case SYSPROF_CAPTURE_FRAME_TIMESTAMP:
|
case SYSPROF_CAPTURE_FRAME_TIMESTAMP:
|
||||||
{
|
{
|
||||||
const SysprofCaptureTimestamp *ts = sysprof_capture_reader_read_timestamp (reader);
|
const SysprofCaptureTimestamp *ts = sysprof_capture_reader_read_timestamp (reader);
|
||||||
g_print ("TIMESTAMP: pid=%d time=%"G_GINT64_FORMAT"\n", ts->frame.pid, ts->frame.time);
|
g_print ("TIMESTAMP: pid=%d time=%" G_GINT64_FORMAT "\n", ts->frame.pid, ts->frame.time);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -248,7 +248,7 @@ main (gint argc,
|
|||||||
gdouble ptime = (def->frame.time - begin_time) / (gdouble)SYSPROF_NSEC_PER_SEC;
|
gdouble ptime = (def->frame.time - begin_time) / (gdouble)SYSPROF_NSEC_PER_SEC;
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
g_print ("NEW COUNTERS: pid=%d time=%"G_GINT64_FORMAT" (%lf)\n", def->frame.pid, def->frame.time, ptime);
|
g_print ("NEW COUNTERS: pid=%d time=%" G_GINT64_FORMAT " (%lf)\n", def->frame.pid, def->frame.time, ptime);
|
||||||
|
|
||||||
for (i = 0; i < def->n_counters; i++)
|
for (i = 0; i < def->n_counters; i++)
|
||||||
{
|
{
|
||||||
@ -274,7 +274,7 @@ main (gint argc,
|
|||||||
gdouble ptime = (set->frame.time - begin_time) / (gdouble)SYSPROF_NSEC_PER_SEC;
|
gdouble ptime = (set->frame.time - begin_time) / (gdouble)SYSPROF_NSEC_PER_SEC;
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
g_print ("SET COUNTERS: pid=%d time=%"G_GINT64_FORMAT" (%lf)\n", set->frame.pid, set->frame.time, ptime);
|
g_print ("SET COUNTERS: pid=%d time=%" G_GINT64_FORMAT " (%lf)\n", set->frame.pid, set->frame.time, ptime);
|
||||||
|
|
||||||
for (i = 0; i < set->n_values; i++)
|
for (i = 0; i < set->n_values; i++)
|
||||||
{
|
{
|
||||||
@ -286,7 +286,7 @@ main (gint argc,
|
|||||||
if (values->ids[j])
|
if (values->ids[j])
|
||||||
{
|
{
|
||||||
if (GET_CTR_TYPE (values->ids[j]) == SYSPROF_CAPTURE_COUNTER_INT64)
|
if (GET_CTR_TYPE (values->ids[j]) == SYSPROF_CAPTURE_COUNTER_INT64)
|
||||||
g_print (" COUNTER(%d): %"G_GINT64_FORMAT"\n",
|
g_print (" COUNTER(%d): %" G_GINT64_FORMAT "\n",
|
||||||
values->ids[j],
|
values->ids[j],
|
||||||
values->values[j].v64);
|
values->values[j].v64);
|
||||||
else if (GET_CTR_TYPE (values->ids[j]) == SYSPROF_CAPTURE_COUNTER_DOUBLE)
|
else if (GET_CTR_TYPE (values->ids[j]) == SYSPROF_CAPTURE_COUNTER_DOUBLE)
|
||||||
@ -304,7 +304,7 @@ main (gint argc,
|
|||||||
const SysprofCaptureAllocation *ev = sysprof_capture_reader_read_allocation (reader);
|
const SysprofCaptureAllocation *ev = sysprof_capture_reader_read_allocation (reader);
|
||||||
gdouble ptime = (ev->frame.time - begin_time) / (gdouble)SYSPROF_NSEC_PER_SEC;
|
gdouble ptime = (ev->frame.time - begin_time) / (gdouble)SYSPROF_NSEC_PER_SEC;
|
||||||
|
|
||||||
g_print ("%s: pid=%d tid=%d addr=0x%"G_GINT64_MODIFIER"x size=%"G_GINT64_FORMAT" time=%"G_GINT64_FORMAT" (%lf)\n",
|
g_print ("%s: pid=%d tid=%d addr=0x%" G_GINT64_MODIFIER "x size=%" G_GINT64_FORMAT " time=%" G_GINT64_FORMAT " (%lf)\n",
|
||||||
ev->alloc_size > 0 ? "ALLOC" : "FREE",
|
ev->alloc_size > 0 ? "ALLOC" : "FREE",
|
||||||
ev->frame.pid, ev->tid,
|
ev->frame.pid, ev->tid,
|
||||||
ev->alloc_addr, ev->alloc_size,
|
ev->alloc_addr, ev->alloc_size,
|
||||||
|
|||||||
Reference in New Issue
Block a user