mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yicong Yang <yangyicong@huawei.com>
To: Qinxin Xia <xiaqinxin@huawei.com>
Cc: <yangyicong@hisilicon.com>, <catalin.marinas@arm.com>,
	<will@kernel.org>, <naveen.n.rao@linux.ibm.com>,
	<anil.s.keshavamurthy@intel.com>, <davem@davemloft.net>,
	<mhiramat@kernel.org>, <linuxarm@huawei.com>,
	<linux-kernel@vger.kernel.org>, <fanghao11@huawei.com>,
	<prime.zeng@hisilicon.com>, <xuwei5@huawei.com>,
	<jonathan.cameron@huawei.com>, Barry Song <baohua@kernel.org>,
	<chris.zjh@huawei.com>
Subject: Re: [PATCH v7] arm64: kprobe: Enable OPTPROBE for arm64
Date: Mon, 31 Mar 2025 11:12:49 +0800	[thread overview]
Message-ID: <5a096fa2-4b3b-931d-453c-ad709e9ba687@huawei.com> (raw)
In-Reply-To: <704bf3e2-be54-4463-b59b-3c1b867e7df0@huawei.com>

On 2025/3/25 20:06, Qinxin Xia wrote:
> 
> 在 2025/3/17 12:01, Yicong Yang 写道:
>> On 2025/2/16 15:00, Qinxin Xia wrote:
>>> This patch introduce optprobe for ARM64. In optprobe, probed
>>> instruction is replaced by a branch instruction to trampoline.
>>>
>>> Performance of optprobe on Hip08 platform is test using kprobe
>>> example module to analyze the latency of a kernel function,
>>> and here is the result:
>>>

[...]

>>> +
>>> +void optprobe_optimized_callback(struct optimized_kprobe *op, struct pt_regs *regs)
>> need to be static.
> ok, I will fix it in the next version.
> It must be referenced by 'optprobe_trampoline.S' and cannot be covered by the static scope.

Then it should be marked as "asmlinkage" and declared in the header.

>>> +{
>>> +    if (kprobe_disabled(&op->kp))
>>> +        return;
>>> +
>>> +    guard(preempt)();
>>> +
>>> +    if (kprobe_running()) {
>>> +        kprobes_inc_nmissed_count(&op->kp);
>>> +    } else {
>>> +        __this_cpu_write(current_kprobe, &op->kp);
>>> +        get_kprobe_ctlblk()->kprobe_status = KPROBE_HIT_ACTIVE;
>>> +        opt_pre_handler(&op->kp, regs);
>>> +        __this_cpu_write(current_kprobe, NULL);
>>> +    }
>>> +}
>>> +NOKPROBE_SYMBOL(optprobe_optimized_callback)

  reply	other threads:[~2025-03-31  3:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-16  7:00 Qinxin Xia
2025-03-17  4:01 ` Yicong Yang
2025-03-25 12:06   ` Qinxin Xia
2025-03-31  3:12     ` Yicong Yang [this message]
2025-03-19  2:36 ` Masami Hiramatsu
2025-03-25 12:21   ` Qinxin Xia
2025-04-03 12:20 ` Yeoreum Yun
2025-04-10  3:33   ` Qinxin Xia
2025-04-03 23:34 ` Masami Hiramatsu
2025-04-10  3:54   ` Qinxin Xia

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=5a096fa2-4b3b-931d-453c-ad709e9ba687@huawei.com \
    --to=yangyicong@huawei.com \
    --cc=anil.s.keshavamurthy@intel.com \
    --cc=baohua@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=chris.zjh@huawei.com \
    --cc=davem@davemloft.net \
    --cc=fanghao11@huawei.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=mhiramat@kernel.org \
    --cc=naveen.n.rao@linux.ibm.com \
    --cc=prime.zeng@hisilicon.com \
    --cc=will@kernel.org \
    --cc=xiaqinxin@huawei.com \
    --cc=xuwei5@huawei.com \
    --cc=yangyicong@hisilicon.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®