Re: [PATCH 0/7] Uprobes: Support SDT markers having reference count (semaphore)

From
Masami Hiramatsu <mhiramat@kernel.org>
Date
2018-06-16 13:50:41
Also in
lkml
Reply to
Ravi Bangoria, 2018-06-11
Hi Ravi,

Sorry for replying later.

On Mon, 11 Jun 2018 10:01:58 +0530
Ravi Bangoria [off-list ref] wrote:
Hi Masami,
quoted
quoted
quoted
Hmm, it sounds simple... maybe we can increment refctr in install_breakpoint/
remove_breakpoint?
Not really, it would be simpler if I can put it inside install_breakpoint().
Consider an mmap() case. Probed instruction resides in the text section whereas
reference counter resides in the data section. These sections gets mapped using
separate mmap() calls. So, when process mmaps the text section we will change the
instruction, but section holding the reference counter may not have been mapped
yet in the virtual memory. If so, we will fail to update the reference counter.
Got it. 
In such case, maybe we can hook the target page mmapped and do install_breakpoint()
at that point. Since the instruction is protected by a refctr, unless mmap the
page on where the refctr is, the program doesn't reach the tracepoint. Is that right?
You mean, when mmap(text) happens, save the target page somewhere and when
mmap(data) happens, update both instruction and ref_ctr?
Yes. I think you can just clone the target(text) page but not install
breakpoint, and if mmap(data) happens, update both.
This sounds feasible. Let me think on it.
Thanks!
Thanks for suggestion,
Ravi

-- 
Masami Hiramatsu [off-list ref]
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Thread (21 messages) 21 messages, 4 authors, last reply 2018-06-21
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help