Diff of /libop/op_mangle.c [ecfbcc] .. [74abfb] Maximize Restore

  Switch to unified view

a/libop/op_mangle.c b/libop/op_mangle.c
...
...
21
21
22
static void append_image(char * dest, int flags, int anon, char const * name, char const * anon_name)
22
static void append_image(char * dest, int flags, int anon, char const * name, char const * anon_name)
23
{
23
{
24
    if ((flags & MANGLE_KERNEL) && !strchr(name, '/')) {
24
    if ((flags & MANGLE_KERNEL) && !strchr(name, '/')) {
25
        strcat(dest, "{kern}/");
25
        strcat(dest, "{kern}/");
26
    } else if (anon) {
26
    } else if (anon && anon_name) {
27
        strcat(dest, "{anon:");
27
        strcat(dest, "{anon:");
28
        strcat(dest, anon_name);
28
        strcat(dest, anon_name);
29
        strcat(dest,"}/");
29
        strcat(dest,"}/");
30
    } else {
30
    } else {
31
        strcat(dest, "{root}/");
31
        strcat(dest, "{root}/");
...
...
51
    char const * cg_image_name = values->cg_image_name;
51
    char const * cg_image_name = values->cg_image_name;
52
52
53
    len = strlen(op_samples_current_dir) + strlen(dep_name) + 1
53
    len = strlen(op_samples_current_dir) + strlen(dep_name) + 1
54
        + strlen(values->event_name) + 1 + strlen(image_name) + 1;
54
        + strlen(values->event_name) + 1 + strlen(image_name) + 1;
55
55
56
  // Just to silence Coverity, check cg_image_name and anon_name below for !=NULL.
56
    if (values->flags & MANGLE_CALLGRAPH)
57
    if (cg_image_name && (values->flags & MANGLE_CALLGRAPH))
57
        len += strlen(cg_image_name) + 1;
58
        len += strlen(cg_image_name) + 1;
58
59
59
  if (anon || cg_anon)
60
  if (anon_name && (anon || cg_anon))
60
        len += strlen(anon_name);
61
        len += strlen(anon_name);
61
62
62
    /* provision for tgid, tid, unit_mask, cpu and some {root}, {dep},
63
    /* provision for tgid, tid, unit_mask, cpu and some {root}, {dep},
63
     * {kern}, {anon} and {cg} marker */
64
     * {kern}, {anon} and {cg} marker */
64
    /* FIXME: too ugly */
65
    /* FIXME: too ugly */