From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B51F9C433B4 for ; Sun, 25 Apr 2021 18:29:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 85DBF6128A for ; Sun, 25 Apr 2021 18:29:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230494AbhDYSaS (ORCPT ); Sun, 25 Apr 2021 14:30:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:43940 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230459AbhDYSaR (ORCPT ); Sun, 25 Apr 2021 14:30:17 -0400 Received: from rorschach.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3D8D86120C; Sun, 25 Apr 2021 18:29:37 +0000 (UTC) Date: Sun, 25 Apr 2021 14:29:35 -0400 From: Steven Rostedt To: Tzvetomir Stoyanov Cc: Joel Fernandes , "Yordan Karadzhov (VMware)" , Linux Trace Devel Subject: Re: Instructions for clock sync for tracing host/guest Message-ID: <20210425142935.52078301@rorschach.local.home> In-Reply-To: References: <20210422153845.3e6e9304@gandalf.local.home> <20210422154830.52f3e4f5@gandalf.local.home> <20210422160313.2eee1f77@gandalf.local.home> X-Mailer: Claws Mail 3.17.4git76 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org On Fri, 23 Apr 2021 11:16:50 +0300 Tzvetomir Stoyanov wrote: > Currently we collect that information from quemu, is there a way to > get it from crosvm ? If yes, a crosvm support can be implemented in > trace-cmd. But as I said, it is not mandatory to have it for the > trace, I can send you a patch next week addressing this gap in the > implementation. I think we should be able to get the above information during the KVM timesync logic. The host can enable KVM events (specifically kvm_entry), and that should give use the pids. # trace-cmd record -e kvm_entry ssh guest taskset -c 0 ls \; taskset -c 1 cat /etc/passwd # trace-cmd report [..] <...>-129042 [004]1122452427093922: kvm_entry: vcpu 0 <...>-129043 [005]1122452427148178: kvm_entry: vcpu 1 <...>-129042 [004]1122452427150380: kvm_entry: vcpu 0 <...>-129043 [005]1122452427201498: kvm_entry: vcpu 1 There, I see the guest vcpu 0 is controlled by the host thread with pid 129042 and vcpu 1 is controlled by host thread pid 129043. -- Steve