Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2793431pxb; Mon, 18 Oct 2021 01:50:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUmu34qPzKnoZWEJthzU0CJARFzD+qszBKQ5gzNGjvUL3T4Al2Q2gesiLpZi2JTpRL3ISG X-Received: by 2002:a17:902:6b48:b0:13f:903c:bc2e with SMTP id g8-20020a1709026b4800b0013f903cbc2emr18523577plt.68.1634547008662; Mon, 18 Oct 2021 01:50:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634547008; cv=none; d=google.com; s=arc-20160816; b=dGrN7lc6xAUwmhfA5n9wV0W8BJddUMLuTkfRAu3eqr1QYzmnZUdgL5UQtokxmV5fbQ EgBZ4QPsqigC+Olpy590jNRgqPyo8MOHfgJ+fh0EIrTBA7g1u3HBjifK0IAmmejBaJHz UXYmBHaFd6U1sx+C0fFh5KAdyMMGt7U5GR3rnLRFvbPBQCPIzM1kRda5ISXI4QstDU7V LQaBeGtkHdAidsVyn2nu7ghPqQTH6gdr2iKJa+z3rXczN6mTTt21l9GtGHp9oR9aWw6K /mB0z7H0cxsolbGXMzWtRAR8c23kHqGYrxVOv9NxIoQ2UZis66/4IP6YtpQw+SCqmWt3 7E6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=OQJ5ixh1fQ3As1s5NKcy4yCXM4x/G7J3kERGZUyu5UI=; b=YPUKrqLZVi5xSO5XGaFiditZLAGRAGM+BYRPnZFm0DjvM5IeFNhVI7CkwrGxzFY9al kX/Ebx0V+5gF1y4g8oKR1LL/r6J/M95aUFz7aIIzT0JOXy/8cnK/1oSAhUTR0CKCilya 1TZMaPxPXwCywIOlTyQCPAbbfPVpfH543+8oTPLz0eLR0YZjPzSxVDGq+uZNe77ZyaIy x7Bp1nzP7veFai9L1/6kWyAlw5PUglm5eAqAYRow6QpGV+sbsteH4kJyKdfk5vCdBbKa g7kn5eAY/NXiaNVkQSznCTi2Ii/aUKw76t/9R88PZ460MYRSbWxNDb+BJ1glA42a7xml Q1Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=p7cH8MGO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g35si20013475pgl.237.2021.10.18.01.49.54; Mon, 18 Oct 2021 01:50:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=p7cH8MGO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231190AbhJRIuj (ORCPT + 99 others); Mon, 18 Oct 2021 04:50:39 -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