[lttng-dev] [PATCH/babeltrace] Fix babeltrace-log get big line when the input file last line don't have enter

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Tue Sep 11 09:29:54 EDT 2012


* Hui Zhu (teawater at gmail.com) wrote:
> Hi,
> 
> I got:
> [Error] Line too large for packet size (32kB) (discarded)
> When I input a file to babeltrace-log.
> That is because the last line of the input file doesn't have enter and
> "babeltrace-log" have bug with the line that doesn't have enter.
> So I post a patch for it.

Merged, thanks!

Mathieu

> 
> Thanks,
> Hui
> 
> --- a/converter/babeltrace-log.c
> +++ b/converter/babeltrace-log.c
> @@ -240,9 +240,11 @@ void trace_text(FILE *input, int output)
>  		if (len < 0)
>  			break;
>  		nl = strrchr(line, '\n');
> -		if (nl)
> +		if (nl) {
>  			*nl = '\0';
> -		trace_string(line, &pos, nl - line + 1);
> +			trace_string(line, &pos, nl - line + 1);
> +		} else
> +			trace_string(line, &pos, strlen(line) + 1);
>  	}
>  	ctf_fini_pos(&pos);
>  }
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list