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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63F12C433EF for ; Mon, 18 Oct 2021 08:48:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4A77960F23 for ; Mon, 18 Oct 2021 08:48:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231307AbhJRIuk (ORCPT ); Mon, 18 Oct 2021 04:50:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:33562 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230006AbhJRIuj (ORCPT ); Mon, 18 Oct 2021 04:50:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BE5A360F02; Mon, 18 Oct 2021 08:48:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634546908; bh=2dm5Ijkya2CLkLIjx7kqKKuqwSeDj7YfNf+Ugr1sE1Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=p7cH8MGOxXrNNxRHyjfVe+rapoMxiG3DPUJ4YzFKPAIw4ycAhKbERTmMmbr9XuE92 eg5URdlYKJx1cvZ2ZWdjXia2KjHny/bLmI9pfeDRA1BQLG5ZXBghp8Bx1jvqGoszN9 iCJZtZ+YkPcw2c1S+ize4sIzjtFqlpyYOrT8M4R8= Date: Mon, 18 Oct 2021 10:48:25 +0200 From: Greg KH To: Dongliang Mu Cc: FMDF , Pavel Skripkin , linux-kernel , Dan Carpenter , kernelnewbies Subject: Re: Any tracing mechanism can track the executed instructions of a user process in the kernel? Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 18, 2021 at 04:41:14PM +0800, Dongliang Mu wrote: > On Mon, Oct 18, 2021 at 4:07 PM FMDF wrote: > > > > On Mon, 18 Oct 2021, 04:46 Dongliang Mu, wrote: > >> > >> Hi all, > >> > >> I am writing to kindly ask one question: is there any tracing > >> mechanism in Linux kernel that can trace all the executed instructions > >> of a user process? If this user process is run on different > >> processors, traces of this process on different processors should be > >> also recorded. > > > > > > You've not explained in detail what is the purpose of the tracing that you want to do. Missing this information I can only provide you a list of links to various tools and methods. Take a look by yourself and try to figure out what is better suited for your needs... > > I want to log all the executed instructions of a user process (e.g., > poc.c in syzkaller) in the kernel mode and then would like to leverage > backward analysis to capture the root cause of kernel panic/crash. > > Therefore, I need the instruction-level tracing mechanisms or tools. Then use a userspace debugger like gdb, that is what they are designed for. good luck! greg k-h