From patchwork Sat Jan 4 17:19:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 3433981 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EFDA3C02DC for ; Sat, 4 Jan 2014 17:21:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 20DD4200F4 for ; Sat, 4 Jan 2014 17:21:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5B70920145 for ; Sat, 4 Jan 2014 17:21:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754855AbaADRUv (ORCPT ); Sat, 4 Jan 2014 12:20:51 -0500 Received: from mout.web.de ([212.227.17.11]:49541 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754795AbaADRUI (ORCPT ); Sat, 4 Jan 2014 12:20:08 -0500 Received: from mchn199C.home ([95.157.58.223]) by smtp.web.de (mrweb004) with ESMTPSA (Nemesis) id 0Lvw4L-1VLCzT1mcH-017iZ7 for ; Sat, 04 Jan 2014 18:20:06 +0100 From: Jan Kiszka To: Steven Rostedt Cc: linux-trace-users@vger.kernel.org, Linux Kernel Mailing List , kvm Subject: [PATCH 3/3] trace-cmd: Fix and cleanup kvm_nested_vmexit tracepoints Date: Sat, 4 Jan 2014 18:19:50 +0100 Message-Id: <8e6c02b22ea8136c139a91c69d6cc73b8c5c184b.1388855989.git.jan.kiszka@web.de> X-Mailer: git-send-email 1.8.1.1.298.ge7eed54 In-Reply-To: References: In-Reply-To: References: X-Provags-ID: V03:K0:fwc0quz09BGPTZ9r2Z/5KJKybykYkep6tHfJWp6oGCLoGrUQiI6 z5WKJfZ1wvYG23TNHpGY8L+RXvgpLn4h7k/tIZDXiF3e7D0UvQBNvJlI9+SFPKegRMr271Y 1jYyysTM+W0sSxVJ+Rp673c7ptHSiVMjywrS8GmPeodcPOF3NxRsbv8Ief8nM4Kp87UN7i/ 1I07BYAN6U9ahsl+2axdw== Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jan Kiszka Fix several issues of kvm_nested_vmexit[_inject]: field width aren't supported with pevent_print, rip was printed twice/incorrectly, SVM ISA was hard-coded, we don't use ':' to separate field names. Signed-off-by: Jan Kiszka --- plugin_kvm.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/plugin_kvm.c b/plugin_kvm.c index c407e55..cb52e9e 100644 --- a/plugin_kvm.c +++ b/plugin_kvm.c @@ -330,19 +330,13 @@ static int kvm_emulate_insn_handler(struct trace_seq *s, struct pevent_record *r static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct pevent_record *record, struct event_format *event, void *context) { - unsigned long long val; - - pevent_print_num_field(s, " rip %0x016llx", event, "rip", record, 1); - - if (pevent_get_field_val(s, event, "exit_code", record, &val, 1) < 0) + if (print_exit_reason(s, record, event, "exit_code") < 0) return -1; - trace_seq_printf(s, "reason %s", find_exit_reason(2, val)); - - pevent_print_num_field(s, " ext_inf1: %0x016llx", event, "exit_info1", record, 1); - pevent_print_num_field(s, " ext_inf2: %0x016llx", event, "exit_info2", record, 1); - pevent_print_num_field(s, " ext_int: %0x016llx", event, "exit_int_info", record, 1); - pevent_print_num_field(s, " ext_int_err: %0x016llx", event, "exit_int_info_err", record, 1); + pevent_print_num_field(s, " info1 %llx", event, "exit_info1", record, 1); + pevent_print_num_field(s, " info2 %llx", event, "exit_info2", record, 1); + pevent_print_num_field(s, " int_info %llx", event, "exit_int_info", record, 1); + pevent_print_num_field(s, " int_info_err %llx", event, "exit_int_info_err", record, 1); return 0; } @@ -350,7 +344,7 @@ static int kvm_nested_vmexit_inject_handler(struct trace_seq *s, struct pevent_r static int kvm_nested_vmexit_handler(struct trace_seq *s, struct pevent_record *record, struct event_format *event, void *context) { - pevent_print_num_field(s, " rip %0x016llx", event, "rip", record, 1); + pevent_print_num_field(s, "rip %lx ", event, "rip", record, 1); return kvm_nested_vmexit_inject_handler(s, record, event, context); }