From: zhaolei@cn.fujitsu.com (Zhaolei)
Subject: [ltt-dev] Updated TODO list before releasing LTTngbufferingtoLKML
Date: Thu, 30 Oct 2008 11:59:23 +0800 [thread overview]
Message-ID: <34DE67E4C79D43D1A262890BE236B15A@zhaoleiwin> (raw)
In-Reply-To: <20081030030551.GB24718@Krystal>
* Mathieu Desnoyers wrote:
>* Zhaolei (zhaolei at cn.fujitsu.com) wrote:
>> * Mathieu Desnoyers wrote:
>> >* Zhaolei (zhaolei at cn.fujitsu.com) wrote:
>> >> * Mathieu Desnoyers wrote:
>> >> >> > - move ltt/ltt-marker-control.c /proc interface to debugfs
>> >> >> > I think we should integrate its directory tree to the new LTTng tracer
>> >> >> > debugfs API like this :
>> >> >> >
>> >> >> > /debugfs/ltt/events/buffer_name/marker_name/
>> >> >> > where we find files like :
>> >> >> > state
>> >> >> > write : 1/0 (on/off)
>> >> >> > read : 1/0 (on/off)
>> >> >> > format
>> >> >> > read : marker format string
>> >> >> Hello, Mathieu,
>> >> >>
>> >> >> So we need to create a marker's debugfs-directory when user insmod
>> >> >> a module with markers.
>> >> >> But i think we don't have a callback when user insmod, and we
>> >> >> should avoid to patch kernel/module.c for this kind of function.
>> >> >>
>> >> >> So, maybe we can only "echo marker_name 0/1" > marker-control.
>> >> >> Dou you have suggestion for me?
>> >> >>
>> >> >
>> >> >
>> >> > Yes, we do have a callback in insmod.
>> >> >
>> >> > See :
>> >> >
>> >> > load_module()
>> >> >
>> >> > #ifdef CONFIG_MARKERS
>> >> > if (!mod->taints)
>> >> > marker_update_probe_range(mod->markers,
>> >> > mod->markers + mod->num_markers);
>> >> > #endif
>> >> >
>> >> > We would probably also have to get a callback in free_module to remove
>> >> > the marker directory entry when the last marker reference is gone. The
>> >> > same
>> >> >
>> >> > #ifdef CONFIG_MARKERS
>> >> > if (!mod->taints)
>> >> > marker_update_probe_range(mod->markers,
>> >> > mod->markers + mod->num_markers);
>> >> > #endif
>> >> >
>> >> > Could probably be used in free_module.
>> >> >
>> >> Do you means we insert another callback as markers do?
>> >> as example in insmod:
>> >> #ifdef CONFIG_MARKERS
>> >> if (!mod->taints)
>> >> marker_update_probe_range(mod->markers,
>> >> mod->markers + mod->num_markers);
>> >> #endif
>> >> #ifdef CONFIG_LTT
>> >> if (!mod->taints)
>> >> lttctl_create_dirs(mod->markers,
>> >> mod->markers + mod->num_markers);
>> >> #endif
>> >>
>> >> It it is true, i think because ltt_control will be a kernel module, and we can't
>> >> call a module's function in load_module().
>> >>
>> >> So, maybe we can do as following:
>> >> 1: make module.c support callbackset.
>> >> add following functions to module.c
>> >> module_register_callback(enum MODULE_CALLBACK_TYPE type, callback_func func);
>> >> module_unregister_callback(LOAD_MODULE, callback_func func);
>> >>
>> >> 2: make marks and ltt_control use new function
>> >> example if ltt_control's
>> >> init() {module_register_callback(LOAD_MODULE, create_debugfs_dir);}
>> >> exit() {module_unregister_callback(LOAD_MODULE, free_debugfs_dir);}
>> >> void create_debugfs_dir(struct module *mod) {
>> >> for (i = 0; i < mod->num_markers; i++ )
>> >> ...
>> >> }
>> >>
>> >
>> > No, no...
>> >
>> > only marker_update_probe_range() needs to be called form module.c, at
>> > load_module() and exit_module().
>> >
>> > It will add a marker entry to the hash table when necessary, and
>> > increment/decrement the reference count of this marker entry. The marker
>> > entry can be removed from the hash table when the refcount falls to 0
>> > and no probe is registered on the marker.
>> >
>> > At the same time the marker entry is added to the hash table, a
>> > debugfs mkdir is done. When the entry is removed from the hash table, a
>> > debugfs rmdir is done.
>> >
>> > Is it a bit more clear ?
>> Hi, Mathieu
>>
>> I see.
>> But IMHO, markers is used by lttng, but is not part of lttng.
>> So, i think source for create files in /debugfs/ltt/... should not be placed in
>> markers.c.
>>
>
> Let's put LTTng in /debugfs/trace/ then, along with markers. I think the
> LTTng name will eventually fade away as bits and pieces gets renamed as
> they are merged into mainline. :)
I understood.
OK, Let us try it.
>
> Mathieu
>
>
>> >
>> > Mathieu
>> >
>> >
>> >
>> >
>> >> _______________________________________________
>> >> ltt-dev mailing list
>> >> ltt-dev at lists.casi.polymtl.ca
>> >> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
>> >>
>> >
>> > --
>> > Mathieu Desnoyers
>> > OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
>> >
>> >
>> _______________________________________________
>> ltt-dev mailing list
>> ltt-dev at lists.casi.polymtl.ca
>> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
>>
>
> --
> Mathieu Desnoyers
> OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
>
>
prev parent reply other threads:[~2008-10-30 3:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-28 15:21 [ltt-dev] Updated TODO list before releasing LTTng buffering to LKML Mathieu Desnoyers
2008-10-29 2:41 ` Zhaolei
2008-10-29 3:19 ` Mathieu Desnoyers
2008-10-29 5:35 ` [ltt-dev] Updated TODO list before releasing LTTng bufferingto LKML Zhaolei
2008-10-29 5:41 ` [ltt-dev] Updated TODO list before releasing LTTng bufferingtoLKML Zhaolei
2008-10-29 15:23 ` [ltt-dev] Updated TODO list before releasing LTTng bufferingto LKML Mathieu Desnoyers
2008-10-30 0:51 ` [ltt-dev] Updated TODO list before releasing LTTng bufferingtoLKML Zhaolei
2008-10-30 3:05 ` Mathieu Desnoyers
2008-10-30 3:59 ` Zhaolei [this message]
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=34DE67E4C79D43D1A262890BE236B15A@zhaoleiwin \
--to=zhaolei@cn.fujitsu.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