Re: [PATCH 1/3] perf timechart: implement IO mode

From: Namhyung Kim
Date: Thu Jun 19 2014 - 21:04:42 EST


Hi Stanislav,

On Thu, 19 Jun 2014 16:23:01 +0400, Stanislav Fomichev wrote:
> In IO mode timechart shows any disk/network activity.
> + for (i = 0; i < disk_events_nr; i++) {
> + if (!is_valid_tracepoint(disk_events[i])) {
> + rec_argc--;

It (and others below) should be 'rec_argc -= 4' - i.e. I still see the
segfault. :)


> + continue;
> + }
> +
> + *p++ = "-e";
> + *p++ = strdup(disk_events[i]);
> + *p++ = "--filter";
> + *p++ = filter;
> + }


[SNIP]
> +void svg_ubox(int Yslot, u64 start, u64 end, double height, const char *type, int fd, int err, int merges)
> +{
> + double w = time2pixels(end) - time2pixels(start);
> + height = normalize_height(height);
> +
> + if (!svgfile)
> + return;
> +
> + fprintf(svgfile, "<g>\n");
> + fprintf(svgfile, "<title>fd=%d error=%d merges=%d</title>\n", fd, err, merges);
> + fprintf(svgfile, "<rect x=\"%.8f\" width=\"%.8f\" y=\"%.1f\" height=\"%.1f\" class=\"%s\"/>\n",

Looks like this change should be applied to the exsting (for cpu and
power events) boxes too. Care to send it as a separate fix?


> + time2pixels(start),
> + w,
> + Yslot * SLOT_MULT,
> + SLOT_HALF * height,
> + type);
> + fprintf(svgfile, "</g>\n");
> +}


[SNIP]
> @@ -579,8 +669,10 @@ void svg_time_grid(void)
> color = 128;
> }
>
> - fprintf(svgfile, "<line x1=\"%4.8f\" y1=\"%4.2f\" x2=\"%4.8f\" y2=\"%" PRIu64 "\" style=\"stroke:rgb(%i,%i,%i);stroke-width:%1.3f\"/>\n",
> - time2pixels(i), SLOT_MULT/2, time2pixels(i), total_height, color, color, color, thickness);
> + if (thickness >= min_thickness)
> + fprintf(svgfile, "<line x1=\"%4.8f\" y1=\"%4.2f\" x2=\"%4.8f\" y2=\"%" PRIu64 "\" style=\"stroke:rgb(%i,%i,%i);stroke-width:%1.3f\"/>\n",

It seems you missed the change above (s/4.8f/.8f/g). :)

Thanks,
Namhyung


> + time2pixels(i), SLOT_MULT/2, time2pixels(i),
> + total_height, color, color, color, thickness);
>
> i += 10000000;
> }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/