lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131123041508.7a37b164@gandalf.local.home>
Date:	Sat, 23 Nov 2013 04:15:08 -0500
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Namhyung Kim <namhyung@...nel.org>
Cc:	Jiri Olsa <jolsa@...hat.com>, linux-kernel@...r.kernel.org,
	Corey Ashford <cjashfor@...ux.vnet.ibm.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...e.hu>, Paul Mackerras <paulus@...ba.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	David Ahern <dsahern@...il.com>
Subject: Re: [PATCH 07/22] tools lib traceevent: Add kvm plugin

On Fri, 22 Nov 2013 23:45:24 +0900
Namhyung Kim <namhyung@...nel.org> wrote:


> > +	pevent_print_num_field(s, " root %u ",  event,
> > +			       "root_count", record, 1);
> > +
> > +	if (pevent_get_field_val(s, event, "unsync", record, &val, 1) < 0)
> > +		return -1;
> 
> Hmm.. it seems this returning from the middle of function can make
> output hard to parse.  How about printing 'unknown' if the field not
> found?

I wasn't fully correct in my last email. If the handler returns
anything but zero, the TP_print() will go in affect. Thus, if this
fails, then the default print will happen anyway.

It shouldn't fail. But yeah, we could think of adding "unknow" and such
too. That can go as a separate patch.

> 
> > +
> > +	trace_seq_printf(s, "%s%c",  val ? "unsync" : "sync", 0);
> 
> Why did you print %c (0) at the end?

I simulated exactly what was (and still is) in the kvm tracepoint:

arch/x86/kvm/mmutrace.h:

        trace_seq_printf(p, "sp gfn %llx %u%s q%u%s %s%s"               \
                         " %snxe root %u %s%c",                         \
                         __entry->gfn, role.level,                      \
                         role.cr4_pae ? " pae" : "",                    \
                         role.quadrant,                                 \
                         role.direct ? " direct" : "",                  \
                         access_str[role.access],                       \
                         role.invalid ? " invalid" : "",                \
                         role.nxe ? "" : "!",                           \
                         __entry->root_count,                           \
                         __entry->unsync ? "unsync" : "sync", 0);	\


-- Steve

> 
> Thanks,
> Namhyung
> 
> 
> > +	return 0;
> > +}
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ