All of lore.kernel.org
 help / color / mirror / Atom feed
From: FMDF <fmdefrancesco@gmail.com>
To: Dongliang Mu <mudongliangabcd@gmail.com>
Cc: Greg KH <gregkh@linuxfoundation.org>,
	Pavel Skripkin <paskripkin@gmail.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	kernelnewbies <kernelnewbies@kernelnewbies.org>
Subject: Re: Any tracing mechanism can track the executed instructions of a user process in the kernel?
Date: Mon, 18 Oct 2021 10:06:56 +0200	[thread overview]
Message-ID: <CAPj211vRdmJZBQvM-DE+saiY=LwoQdOu0hV-YFcny6worQ46rg@mail.gmail.com> (raw)
In-Reply-To: <CAD-N9QWd6Orm8d9AMk7mybByAKZod=GJ-HSNPOfhFDStSPwSUA@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1773 bytes --]

On Mon, 18 Oct 2021, 04:46 Dongliang Mu, <mudongliangabcd@gmail.com> 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...

https://lwn.net/Kernel/Index/#Development_tools-Kernel_tracing
trace-cmd: https://trace-cmd.org
perf ftrace: <Linux source>/tools/perf/Documentation/perf-trace.txt
perf-tools: https://github.com/brendangregg/perf-tools

In particular, the "function_graph" tracer of ftrace seems to be suited for
your purposes:

https://man7.org/linux/man-pages/man1/trace-cmd.1.html
https://man7.org/linux/man-pages/man1/trace-cmd-record.1.html
https://man7.org/linux/man-pages/man1/trace-cmd-report.1.html

Obviously, gdb (and friends) is still invaluable (but it may be difficult
to use, depending on your knowledge and experience, so use it if you really
know that  you need it):

https://www.kernel.org/doc/html/latest/dev-tools/gdb-kernel-debugging.html
https://www.kernel.org/doc/html/latest/dev-tools/kgdb.html

Regards,

Fabio M. De Francesco


> Any comment is welcome.
>
> --
> My best regards to you.
>
>      No System Is Safe!
>      Dongliang Mu
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>

[-- Attachment #1.2: Type: text/html, Size: 3611 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

  parent reply	other threads:[~2021-10-18  8:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-18  2:45 Any tracing mechanism can track the executed instructions of a user process in the kernel? Dongliang Mu
2021-10-18  2:45 ` Dongliang Mu
2021-10-18  4:09 ` Aruna Hewapathirane
2021-10-18  7:08 ` Pavel Skripkin
2021-10-18  7:08   ` Pavel Skripkin
2021-10-18  8:06 ` FMDF [this message]
2021-10-18  8:41   ` Dongliang Mu
2021-10-18  8:41     ` Dongliang Mu
2021-10-18  8:48     ` Greg KH
2021-10-18  8:48       ` Greg KH
2021-10-18  9:17     ` Dongliang Mu
2021-10-18  9:17       ` Dongliang Mu
2021-10-18  9:48       ` FMDF
2021-10-18 10:12         ` FMDF
2021-10-18 15:10     ` Valdis Klētnieks
2021-10-18 15:10       ` Valdis Klētnieks
2021-10-18 21:00 ` jim.cromie
2021-10-18 21:00   ` jim.cromie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPj211vRdmJZBQvM-DE+saiY=LwoQdOu0hV-YFcny6worQ46rg@mail.gmail.com' \
    --to=fmdefrancesco@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mudongliangabcd@gmail.com \
    --cc=paskripkin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.