linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: Aravinda Prasad <aravinda@linux.vnet.ibm.com>,
	Jiri Slaby <jirislaby@gmail.com>
Cc: linux-kernel@vger.kernel.org, Vojtech Pavlik <vojtech@suse.cz>,
	Michael Matz <matz@suse.de>, Jiri Kosina <jkosina@suse.cz>,
	Steven Rostedt <rostedt@goodmis.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@redhat.com>
Subject: Re: [RFC 03/16] kgr: initial code
Date: Wed, 14 May 2014 12:44:33 +0200	[thread overview]
Message-ID: <53734911.30306@suse.cz> (raw)
In-Reply-To: <5373483E.50300@linux.vnet.ibm.com>

On 05/14/2014 12:41 PM, Aravinda Prasad wrote:
> 
> 
> On Wednesday 14 May 2014 03:42 PM, Jiri Slaby wrote:
>> On 05/14/2014 11:28 AM, Aravinda Prasad wrote:
>>> On Wednesday 30 April 2014 08:00 PM, Jiri Slaby wrote:
>>>> From: Jiri Kosina <jkosina@suse.cz>
>>>>
>>>> Provide initial implementation. We are now able to do ftrace-based
>>>> runtime patching of the kernel code.
>>>>
>>>> In addition to that, we will provide a kgr_patcher module in the next
>>>> patch to test the functionality.
>>>
>>> Hi Jiri,
>>>
>>> Interesting! I have couple of comments:
>>>
>>> I think with kgraft (also with kpatch, though have not looked into
>>> it yet), the patched function cannot be dynamically ftraced.
>>> Though dynamic ftrace can be enabled on the new code, the user is
>>> required to know the function label of the new code. This could
>>> potentially break existing scripts. I think this should be documented.
>>
>> Hi,
>>
>> of course that the functions can be traced. Look, I turned on tracing
>> for capable, then patched, then turned on tracing for new_capable (which
>> is the patched function). So now, trace shows:
>>   console-kit-dae-535   [001] ...1   181.729698: capable <-vt_ioctl
>>  console-kit-dae-539   [001] ...1   181.729741: capable <-vt_ioctl
>>  console-kit-dae-541   [000] .N.1   181.906014: capable <-vt_ioctl
>>          systemd-1     [001] ...1   181.937328: capable <-SyS_epoll_ctl
>>             sshd-662   [001] ...1   246.437561: capable <-sock_setsockopt
>>             sshd-662   [001] ...1   246.437564: new_capable
>> <-sock_setsockopt
>>             sshd-662   [001] ...1   246.444790: capable <-sock_setsockopt
>>             sshd-662   [001] ...1   246.444793: new_capable
>> <-sock_setsockopt
>>      dbus-daemon-128   [000] .N.1   246.456307: capable <-SyS_epoll_ctl
>>      dbus-daemon-128   [000] ...1   246.456611: new_capable <-SyS_epoll_ctl
>>
>>
>> There is no limitation thanks to the use of the ftrace subsystem. We are
>> just another user, i.e. another piece of code called in a loop for a
>> particular fentry location.
> 
> Yes true. What I intended to mention is that: the trace is turned on
> for "capable" then the function is patched. Eventually, once the patch
> is finalized, there will be no trace log for "capable". Someone tracing
> the function "capable", not aware of patching, may think that it has not
> been invoked. The user, hence, is expected to start tracing
> "new_capable". I think this should be documented.

As you can see in the trace log above, no. fentry of capable is still
traced (and new_capable is traced along)...

> What if someone turns on tracing for "capable" after it is patched?
> Will it overwrite the slow/fast stub?

Nope, it would look like in the example above.

thanks,
-- 
js
suse labs

  reply	other threads:[~2014-05-14 10:44 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-30 14:30 [RFC 00/16] kGraft Jiri Slaby
2014-04-30 14:30 ` [RFC 01/16] ftrace: Add function to find fentry of function Jiri Slaby
2014-04-30 14:48   ` Steven Rostedt
2014-04-30 14:58     ` Jiri Slaby
2014-04-30 14:30 ` [RFC 02/16] ftrace: Make ftrace_is_dead available globally Jiri Slaby
2014-04-30 14:30 ` [RFC 03/16] kgr: initial code Jiri Slaby
2014-04-30 14:56   ` Steven Rostedt
2014-04-30 14:57     ` Jiri Slaby
2014-05-01 20:20   ` Andi Kleen
2014-05-01 20:37     ` Jiri Kosina
2014-05-14  9:28   ` Aravinda Prasad
2014-05-14 10:12     ` Jiri Slaby
2014-05-14 10:41       ` Aravinda Prasad
2014-05-14 10:44         ` Jiri Slaby [this message]
2014-05-14 11:19           ` Aravinda Prasad
2014-05-20 11:36     ` Jiri Slaby
2014-05-21 18:28       ` Aravinda Prasad
2014-05-26  8:50       ` Jiri Kosina
2014-04-30 14:30 ` [RFC 04/16] kgr: add testing kgraft patch Jiri Slaby
2014-05-06 11:03   ` Pavel Machek
2014-05-12 12:50     ` Jiri Slaby
2014-04-30 14:30 ` [RFC 05/16] kgr: update Kconfig documentation Jiri Slaby
2014-05-03 14:32   ` Randy Dunlap
2014-04-30 14:30 ` [RFC 06/16] kgr: add Documentation Jiri Slaby
2014-05-06 11:03   ` Pavel Machek
2014-05-09  9:31     ` kgr: dealing with optimalizations? (was Re: [RFC 06/16] kgr: add Documentat)ion Pavel Machek
2014-05-09 12:22       ` Michael Matz
2014-04-30 14:30 ` [RFC 07/16] kgr: trigger the first check earlier Jiri Slaby
2014-04-30 14:30 ` [RFC 08/16] kgr: sched.h, introduce kgr_task_safe helper Jiri Slaby
2014-04-30 14:30 ` [RFC 09/16] kgr: mark task_safe in some kthreads Jiri Slaby
2014-04-30 15:49   ` Greg Kroah-Hartman
2014-04-30 16:55   ` Paul E. McKenney
2014-04-30 18:33     ` Vojtech Pavlik
2014-04-30 19:07       ` Paul E. McKenney
2014-05-01 14:24   ` Tejun Heo
2014-05-01 20:17     ` Jiri Kosina
2014-05-01 21:02       ` Tejun Heo
2014-05-01 21:09         ` Tejun Heo
2014-05-14 14:59           ` Jiri Slaby
2014-05-14 15:15             ` Vojtech Pavlik
2014-05-14 15:30               ` Paul E. McKenney
2014-05-14 16:32               ` Tejun Heo
2014-05-15  3:53                 ` Mike Galbraith
2014-05-15  4:06                   ` Tejun Heo
2014-05-15  4:46                     ` Mike Galbraith
2014-05-15  4:50                       ` Tejun Heo
2014-05-15  5:04                         ` Mike Galbraith
2014-05-15  5:09                           ` Tejun Heo
2014-05-15  5:32                             ` Mike Galbraith
2014-05-15  6:05                               ` Tejun Heo
2014-05-15  6:32                                 ` Mike Galbraith
2014-04-30 14:30 ` [RFC 10/16] kgr: kthreads support Jiri Slaby
2014-04-30 14:30 ` [RFC 11/16] kgr: handle irqs Jiri Slaby
2014-04-30 14:30 ` [RFC 12/16] kgr: add tools Jiri Slaby
2014-05-06 11:03   ` Pavel Machek
2014-04-30 14:30 ` [RFC 13/16] kgr: add MAINTAINERS entry Jiri Slaby
2014-04-30 14:30 ` [RFC 14/16] kgr: x86: refuse to build without fentry support Jiri Slaby
2014-04-30 14:30 ` [RFC 15/16] kgr: add procfs interface for per-process 'kgr_in_progress' Jiri Slaby
2014-04-30 14:30 ` [RFC 16/16] kgr: make a per-process 'in progress' flag a single bit Jiri Slaby

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=53734911.30306@suse.cz \
    --to=jslaby@suse.cz \
    --cc=aravinda@linux.vnet.ibm.com \
    --cc=fweisbec@gmail.com \
    --cc=jirislaby@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matz@suse.de \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=vojtech@suse.cz \
    /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;
as well as URLs for NNTP newsgroup(s).