This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH broken] PR10257: Add support for sprint[ln](@hist_*).


First, I'm skeptical of how useful sprint for histograms will be -- it seems like it will quite easily exceed MAXSTRINGLEN. I'm pretty sure this is why we haven't already enabled it. Did you have some specific use in mind?

On 10/10/2009 02:51 PM, Przemyslaw Pawelczyk wrote:
Currently this patch doesn't work, because tmpvar added in sprint case
in c_unparser::visit_print_format() doesn't increase number of __tmp
variables available in struct probe_XYZ_locals that is generated by
c_unparser::emit_common_header(). I certainly missed sth, but what?
Any help will be appreciated. Reviews are also welcomed.

There is also c_tmpcounter which needs to mirror the tmp allocations. This is a sort of pre-visitor which creates the tmps in the context struct.


+static void _stp_stat_print_histogram_buf(char *buf, Hist st, stat *sd)

So much duplication with _stp_stat_print_histogram is not ok -- can you make one a function of the other? It may help you to know that these are equivalent:


  _stp_printf(fmt, ...args...);
  _stp_snprintf(NULL, 0, fmt, ...args...);


Josh



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]