From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH] trace-cmd: Report unknown VMX exit reasons with code Date: Fri, 04 Oct 2013 15:40:29 +0200 Message-ID: <524EC54D.5060503@web.de> References: <5207446F.1090703@web.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="eOl01GiT5mH8U3FmODS770aGIIvNmKXe7" Cc: Linux Kernel Mailing List , kvm To: Steven Rostedt Return-path: In-Reply-To: <5207446F.1090703@web.de> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --eOl01GiT5mH8U3FmODS770aGIIvNmKXe7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2013-08-11 09:59, Jan Kiszka wrote: > From: Jan Kiszka >=20 > Allows to parse the result even if the KVM plugin does not yet > understand a specific exit code. >=20 > Signed-off-by: Jan Kiszka > --- > plugin_kvm.c | 12 ++++++++---- > 1 files changed, 8 insertions(+), 4 deletions(-) >=20 > diff --git a/plugin_kvm.c b/plugin_kvm.c > index 8a25cf1..59443e5 100644 > --- a/plugin_kvm.c > +++ b/plugin_kvm.c > @@ -240,9 +240,8 @@ static const char *find_exit_reason(unsigned isa, i= nt val) > for (i =3D 0; strings[i].val >=3D 0; i++) > if (strings[i].val =3D=3D val) > break; > - if (strings[i].str) > - return strings[i].str; > - return "UNKNOWN"; > + > + return strings[i].str; > } > =20 > static int kvm_exit_handler(struct trace_seq *s, struct pevent_record = *record, > @@ -251,6 +250,7 @@ static int kvm_exit_handler(struct trace_seq *s, st= ruct pevent_record *record, > unsigned long long isa; > unsigned long long val; > unsigned long long info1 =3D 0, info2 =3D 0; > + const char *reason; > =20 > if (pevent_get_field_val(s, event, "exit_reason", record, &val, 1) < = 0) > return -1; > @@ -258,7 +258,11 @@ static int kvm_exit_handler(struct trace_seq *s, s= truct pevent_record *record, > if (pevent_get_field_val(s, event, "isa", record, &isa, 0) < 0) > isa =3D 1; > =20 > - trace_seq_printf(s, "reason %s", find_exit_reason(isa, val)); > + reason =3D find_exit_reason(isa, val); > + if (reason) > + trace_seq_printf(s, "reason %s", reason); > + else > + trace_seq_printf(s, "reason UNKNOWN (%llu)", val); > =20 > pevent_print_num_field(s, " rip 0x%lx", event, "guest_rip", record, 1= ); > =20 >=20 Ping. While my other patch of that time was merged, this one didn't make it yet. Any open issues? Jan --eOl01GiT5mH8U3FmODS770aGIIvNmKXe7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlJOxVAACgkQitSsb3rl5xTLsgCfblACSBcLur5PezRU9Qe5J8J5 G4kAn2jJuuCAx6xHe3p3NmiO/P661m1B =VjCs -----END PGP SIGNATURE----- --eOl01GiT5mH8U3FmODS770aGIIvNmKXe7--