lttng-dev Digest, Vol 67, Issue 48
A message that is not in the archive (sent off-list or not yet received): [email protected]
Jim Dumont
AppliedHi there,
Was there a follow-up to the series of questions raised by Daniel below and referenced here:
http://lists.lttng.org/pipermail/lttng-dev/2013-November/021844.html
I didn't see one in the mailing list.
BR,
/Jim
-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: November-17-13 4:37 AM
To: [email protected]
Subject: lttng-dev Digest, Vol 67, Issue 48
Send lttng-dev mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific than "Re: Contents of lttng-dev digest..."
Today's Topics:
1. Re: [RELEASE] LTTng-Tools 2.4.0-rc1 - ?poque Opaque (Thibault, Daniel)
2. [RELEASE] LTTng-UST 2.4.0-rc1 (Mathieu Desnoyers)
3. [RELEASE] LTTng modules 2.4.0-rc1 (Mathieu Desnoyers)
4. Re: ??? how does ust tracer map share lttng buffer (David Goulet)
5. Re: [PATCH v3 2/2] Implement base-address-state tracing (Amit Margalit)
----------------------------------------------------------------------
Message: 1
Date: Fri, 15 Nov 2013 20:22:34 +0000
From: "Thibault, Daniel" <[email protected]>
To: "[email protected]" <[email protected]>
Subject: Re: [lttng-dev] [RELEASE] LTTng-Tools 2.4.0-rc1 - ?poque
Opaque
Message-ID:
<48CF5AC71E61DB46B70D0F388054EFFD267A2503@VAL-E-01.valcartier.drdc-rddc.gc.ca>
Content-Type: text/plain; charset="iso-8859-1"
-----Message d'origine-----
Date: Fri, 15 Nov 2013 12:27:01 -0500
From: David Goulet <[email protected]>
Quoted 8 lines
1) Live support. It's now possible to stream traces (kernel and UST) while they being extracted meaning a relayd can now receive traces live and a viewer can attach to it to process the trace while running. The "--live" has been added to lttng create command that sets up a live tracing session.
See
doc/live-reading-howto.txtanddoc/live-reading-protocol.txtfor more detail on that feature.
Does this mean you can't do a "live" trace to local storage?
Quoted 9 lines
2) Java Util Logging support. With a special LTTngAgent located in lttng-ust project (liblttng-ust-jul) to trace JUL events and gather UST traces with them.
The -j/--jul domain has been added to lttng command line so you can list the possible JUL Logger object and enable/disable them. It is the same as using the UST or Kernel domain.
As of now, filters and loglevel are ignored with the JUL domain.
Saying "It is the same as using the UST or Kernel domain" leaves a lot of questions unanswered, since the kernel and user-space behave *very* differently on a lot of points.
1) Does --jul require root privileges?
2) I suppose the various commands have --kernel pre-empting --userspace pre-empting --ul?
3) add-context: does --jul have the same possible context types as --userspace (i.e. ip, pthread_id, procname, vpid, vtid)?
4) enable-channel:
4.1) Are the --jul --subbuf-size, --num-subbuf and --read-timer defaults the same as with --userspace? 4.2) Presumably --output can only be mmap?
4.3) Are the --jul buffering schemes the same as with --userspace (i.e. --buffers-pid and --buffers-uid)? 4.4) If yes, won't they all degenerate to the virtual machine's user and process IDs?
5) enable-event:
5.1) Can you assign --jul events to multiple channels like you can in --userspace?
5.2) Is the --jul event type --tracepoint or something else entirely?
5.3) Can the trailing wild card (and exclusion option) be used in the event name when enabling/disabling --jul events?
6) list: Does bug #654 also apply to --jul?
Daniel U. Thibault
Protection des syst?mes et contremesures (PSC) | Systems Protection & Countermeasures (SPC) Cyber s?curit? pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS) R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) | Defence R&D Canada - Valcartier (DRDC Valcartier) 2459 route de la Bravoure
Qu?bec QC G3J 1X5
CANADA
Vox : (418) 844-4000 x4245
Fax : (418) 844-4538
NAC : 918V QSDJ <http://www.travelgis.com/map.asp?addr=918V%20QSDJ>
Gouvernement du Canada | Government of Canada <http://www.valcartier.drdc-rddc.gc.ca/>
------------------------------
Message: 2
Date: Fri, 15 Nov 2013 21:10:00 +0000 (UTC)
From: Mathieu Desnoyers <[email protected]>
To: lttng-dev <[email protected]>
Subject: [lttng-dev] [RELEASE] LTTng-UST 2.4.0-rc1 Message-ID:
<[email protected]>
Content-Type: text/plain; charset=utf-8
LTTng-UST, the Linux Trace Toolkit Next Generation Userspace Tracer, is port of the low-overhead tracing capabilities of the LTTng kernel tracer to user-space. The library "liblttng-ust" enables tracing of applications and libraries.
Main changes: Java Util Logging support, live streaming support, event "excluders" (courtesy of Mentor), base address tracing for symbol lookup (courtesy of Mentor).
Changelog:
2013-11-15 lttng-ust 2.4.0-rc1
* doc/examples: error out when a subdir make fails
* JUL: fix out of tree build
* Java/jul: fix make dist
* JUL: install documentation and jar file
* Add missing copyrights to test scripts
* Escape minus signs in lttng-ust-cyg-profile manpage
* Fix spelling mistake in lttng-ust manpage
* Fix tests/benchmark
* Implement base-address-state tracing
* Base-address tracing for dlopen and dlclose
* Add a check against excluders
* Add handler for LTTNG_UST_EXCLUSION in UST ABI
* Store exclusions to enablers
* Add excluders to enabler structure
* Send exclusion data through ustcomm
* Define exclusion structure for UST ABI
* Define a new command LTTNG_UST_EXCLUSION
* Fix: package of LTTngUst.h was renamed without renaming target in makefile
* Fix: check for java .class in package subfolders
* Fix: java library to use user define JDK at compile time
* Add liblttng-ust-jul for JUL support
* Fix: application SIGBUS when starting in parallel with sessiond
* Fix: Minor corrections to the lttng-ust man page
* Documentation cleanup: Overhaul of the lttng-gen-tp man page
* Warning cleanup: add missing padding initializer
* Fix: socket connect hang on heavy loads
* Cleanup: fix typo
* Fix: ust-comm recvmsg should handle partial receive
* gcc warning fix: -Wextra
* Add usage reference count for tracepoints
* tracepoint.c: Move add_callsite/remove_callsite further down in file
* Store the callsites into the library callsite list
* Fix linking warning
* Per-stream ioctl to get the current timestamp
* LTTng ringbuffer ABI calls for index generation
* Specialize lttng_ust_lib_ring_buffer_client_cb
* Add tracing instrumentation for pthread mutex lock functions
Project website: http://lttng.org
Download link: http://lttng.org/download (please refer to the README file for installation instructions)
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
------------------------------
Message: 3
Date: Fri, 15 Nov 2013 21:12:06 +0000 (UTC)
From: Mathieu Desnoyers <[email protected]>
To: lttng-dev <[email protected]>
Subject: [lttng-dev] [RELEASE] LTTng modules 2.4.0-rc1 Message-ID:
<[email protected]>
Content-Type: text/plain; charset=utf-8
The LTTng modules provide Linux kernel tracing capability to the LTTng 2.x tracer toolset.
Major changes: live streaming support, index generation by consumerd support, 3.12 Linux kernel support.
Changelog:
2013-11-15 LTTng modules 2.4.0-rc1
* Update ext4 instrumentation to Linux 3.12
* Update RCU instrumentation to Linux 3.12
* Update btrfs instrumentation to 3.12 kernel
* Update vmscan instrumentation to Linux 3.12
* update: kmem instrumentation 3.12 kernel support
* lttng-statedump-impl: Use generic hard irqs for Linux >= 3.12
* lttng-statedump-impl: Fix lttng_list_interrupts for empty implementation
* Import fix from LTSI: 3.4+ RT kernels use CONFIG_PREEMPT_RT_FULL
* Add new tracepoint in KVM
* Blacklist kernels 3.10.13 and 3.11.2
* LTTng trace-clock: shrink kernel blacklist
* Metadata flush writes data from the cache
* Per-stream ioctl to get the current timestamp
* LTTng ringbuffer ABI calls for index generation
* Prepare LTTng override of ring buffer fops
* Blacklist Linux kernels 3.10+
Project website: http://lttng.org
Download link: http://lttng.org/download
(please refer to the README files for installation instructions and lttng-tools doc/quickstart.txt for usage information)
Signature · 17 lines
Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com ------------------------------ Message: 4 Date: Sat, 16 Nov 2013 08:42:15 -0500 From: David Goulet <[email protected]> To: ??? <[email protected]> Cc: lttng-dev <[email protected]> Subject: Re: [lttng-dev] ??? how does ust tracer map share lttng buffer Message-ID: <20131116134215.GA7300@thessa> Content-Type: text/plain; charset="utf-8"
Quoted 4 lines · ???
Quoted 1 line
Indeed, from a sessiond point of view, this will typically use the same FD number, but it's really associated with a different posix SHM each time.
Yes,what confused me the most is that sessiond sends the same FD number to UST every time,but UST receives the different FD number each time and can map it to the right per-cpu share buffer sucessfully.
Yes, in per UID buffers, for every application using UST we send the FD corresponding to the already allocated buffer (being per UID).
Please note that sending a FD through a Unix socket dups it so basically UST receives that, access the shared memory buffer and can then operate correctly.
Cheers!
David
Quoted 41 lines
Thanks
MuXiu.CaoFrom: "???" <[email protected]>
To: "mathieu.desnoyers" <[email protected]>
Sent: Friday, November 15, 2013 11:37:11 AM
Subject: how does ust tracer map share lttng bufferHi,Mathieu
After lttng sub-command enable-event is issued at first time, lttng-consumerd will be informed by lttng-sessiond to open and mmap share memory regions .Then lttng-sessiond get all shmfds from lttng-consumerd.But how does ust tracer map to these share memory regions?
AFAIK,lttng-sessiond will call
do_consumer_create_channel(),thensend_channel_uid_to_ust(). What's confused me is in send_channel_uid_to_ust(),lttng-sessionddup()one shmfd , thenust_consumer_send_stream_to_ust()to ust tracer, then close the shmfd and loop all shmfds. So all duped fds are the same fd-number (say A)and send to ust tracer through ust_consumer_send_stream_to_ust()->ustctl_send_stream_to_ust()->ustctl_send_stream()->ustcomm_send_fds_unix_sock()(unix socket is $HOME/.lttng/lttng-ust-sock-5).Why does it send the same fds to ust tracer? At ust tracer side,it calls handle_message()->ustcomm_recv_stream_from_sessiond() and mmap every received fd to share memory region.However,every received fd is different from A.So I must miss something anywhere.How does ust tracer map share lttng buffer?In lttng-sessiond, we send file descriptors for each posix SHM associated to every per-cpu buffer to the application over unix socket. So it's more or less : receive FD from consumer, send FD over unix socket to UST, close FD (we loop on this). Indeed, from a sessiond point of view, this will typically use the same FD number, but it's really associated with a different posix SHM each time. David can probably answer your question in more detail.
Thanks,
Mathieu
Quoted 17 lines
PS:code is from lttng-2.3.0 .
Thanks
MuXiu.CaoSignature · 3 lines
Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: Digital signature
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20131116/afbf97a4/attachment-0001.pgp>
------------------------------
Message: 5
Date: Sun, 17 Nov 2013 11:36:19 +0200
From: Amit Margalit <[email protected]>
To: Mathieu Desnoyers <[email protected]>
Cc: [email protected]
Subject: Re: [lttng-dev] [PATCH v3 2/2] Implement base-address-state
tracing
Message-ID:
<OF5EA7C09A.2F75FE97-ONC2257C26.00348FD3-C2257C26.0034C2F3@il.ibm.com>
Content-Type: text/plain; charset="us-ascii"
I guess I missed something in the discussion - is this going to be active all the time, or can I disable it somehow?
Maybe a command-line switch to turn this off?
For me this is overhead that I don't need and don't want.
Thanks,
Amit Margalit
IBM XIV - Storage Reinvented
XIV-NAS Development Team
Tel. 03-689-7774
Fax. 03-689-7230
From: Mathieu Desnoyers <[email protected]> To: Paul Woegerer <[email protected]>
Date: 11/14/2013 09:30 PM Subject: Re: [lttng-dev] [PATCH v3 2/2] Implement
base-address-state tracing
----- Original Message -----
Quoted 2 lines
From: "Paul Woegerer" <[email protected]>
To: [email protected], "mathieu desnoyers"
Quoted 5 lines
Sent: Thursday, November 14, 2013 1:39:49 PM
Subject: [PATCH v3 2/2] Implement base-address-state tracingDump the base-address state (executable and shared objects) into session on session-enable (per-session events).
Merged, thanks !
Mathieu
Quoted 9 lines
Signed-off-by Paul Woegerer <[email protected]>--- include/lttng/ust-tracepoint-event.h | 14 +++++++ liblttng-ust-baddr/Makefile.am | 4 +- liblttng-ust-baddr/lttng-ust-baddr.c | 72 ++++++++++++++++++++++++++++++++ liblttng-ust-baddr/ust_baddr_statedump.c | 21 ++++++++++ liblttng-ust-baddr/ust_baddr_statedump.h | 60
++++++++++++++++++++++++++
Quoted 3 lines
liblttng-ust/lttng-events.c | 2 + liblttng-ust/lttng-tracer-core.h | 3 ++ liblttng-ust/lttng-ust-comm.c | 60
++++++++++++++++++++++++++
Quoted 10 lines
8 files changed, 235 insertions(+), 1 deletion(-) create mode 100644 liblttng-ust-baddr/ust_baddr_statedump.c create mode 100644 liblttng-ust-baddr/ust_baddr_statedump.hinclude/lttng/ust-tracepoint-event.h +0
-0
include/lttng/ust-tracepoint-event.h size_t · line 484
Quoted 5 lines
include/lttng/ust-tracepoint-event.h +1
-0@@ -480,6 +480,18 @@ size_t __event_get_align__##_provider##___##_name(_TP_ARGS_PROTO(_args)) \#define TP_FIELDS (...) __VA_ARGS__/* +* For state dump, check that "session" argument (mandatory) matches
the
include/lttng/ust-tracepoint-event.h size_t · line 485
Quoted 1 line
include/lttng/ust-tracepoint-event.h +1
-0+* session this event belongs to. Ensures that we write state dump data
only
Quoted 14 lines
include/lttng/ust-tracepoint-event.h +10
-0+* into the started session, not into all sessions. +*/ +#undef _TP_SESSION_CHECK +#ifdef TP_SESSION_CHECK +#define _TP_SESSION_CHECK (session, csession) (session == csession) +#else /* TP_SESSION_CHECK */ +#define _TP_SESSION_CHECK (session, csession) 1 +#endif /* TP_SESSION_CHECK */ + +/* * Using twice size for filter stack data to hold size and pointer for * each field (worse case). For integers, max size required is 64-bit. * Same for double-precision floats. Those fit within
include/lttng/ust-tracepoint-event.h void · line 521
Quoted 4 lines
include/lttng/ust-tracepoint-event.h +0
-0@@ -506,6 +518,8 @@ void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args)) \ \ if (0) \ (void) __dynamic_len_idx; /* don't warn
if unused */ \
include/lttng/ust-tracepoint-event.h void · line 524
Quoted 3 lines
include/lttng/ust-tracepoint-event.h +2
-0+if (!_TP_SESSION_CHECK (session, __chan->session)) \ +return ; \ if
(caa_unlikely(!CMM_ACCESS_ONCE(__chan->session->active))) \
Review
Quoted 3 lines
include/lttng/ust-tracepoint-event.h +0
-0return ; \if (caa_unlikely(!CMM_ACCESS_ONCE(__chan->enabled))) \(quoted diff) +0
-0
b/liblttng-ust-baddr/Makefile.am
Quoted 28 lines
index afa9489..0d3cf28 100644
liblttng-ust-baddr/Makefile.am +3
-1@@ -5,7 +5,9 @@ lib_LTLIBRARIES = liblttng-ust-baddr.la liblttng_ust_baddr_la_SOURCES = \ lttng-ust-baddr.c \ ust_baddr.c \ - ust_baddr.h + ust_baddr.h \ + ust_baddr_statedump.c \ + ust_baddr_statedump.h liblttng_ust_baddr_la_LIBADD = \ -L$(top_builddir)/liblttng-ust/.libs \ -llttng-ustliblttng-ust-baddr/lttng-ust-baddr.c +1
-0@@ -34,6 +34,7 @@#define TRACEPOINT_DEFINE #include "ust_baddr.h" +#include "ust_baddr_statedump.h" int lttng_ust_push_baddr (void *so_base,const char *so_name)
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 68
Quoted 6 lines
liblttng-ust-baddr/lttng-ust-baddr.c +3
-0@@ -62,3 +63,74 @@ lttng_ust_pop_baddr(void *so_base)tracepoint (ust_baddr, pop, so_base);return 0 ; } + +static int +extract_soinfo_events(struct dl_phdr_info *info, size_t size, void
*data)
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 81
Quoted 13 lines
liblttng-ust-baddr/lttng-ust-baddr.c +13
-0+{ +int j; +int num_loadable_segment =0 ; + +for (j =0 ; j < info->dlpi_phnum; j++) { +char resolved_path[PATH_MAX ]; +struct stat sostat; +void *base_addr_ptr; + +if (info->dlpi_phdr[j].p_type !=PT_LOAD ) +continue ; + +/* Calculate virtual memory address of
the loadable segment */
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 83
Quoted 2 lines
liblttng-ust-baddr/lttng-ust-baddr.c +2
-0+ base_addr_ptr = (void *) info->dlpi_addr + +
info->dlpi_phdr[j].p_vaddr;
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 86
Quoted 3 lines
liblttng-ust-baddr/lttng-ust-baddr.c +3
-0+ + num_loadable_segment +=1 ; + if ((info->dlpi_name == NULL ||
info->dlpi_name[0] == 0)
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 87
Quoted 1 line
liblttng-ust-baddr/lttng-ust-baddr.c +1
-0+ &&
num_loadable_segment == 1) {
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 89
Quoted 2 lines
liblttng-ust-baddr/lttng-ust-baddr.c +2
-0+/* +* If the iterated
element is the executable itself we
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 90
Quoted 1 line
liblttng-ust-baddr/lttng-ust-baddr.c +1
-0+* have to use Dl_info to
determine its full path
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 93
Quoted 3 lines
liblttng-ust-baddr/lttng-ust-baddr.c +3
-0+*/ +Dl_info dl_info = {0 }; + if
(!dladdr(base_addr_ptr, &dl_info))
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 95
Quoted 2 lines
liblttng-ust-baddr/lttng-ust-baddr.c +2
-0+return 0 ; + if
(!realpath(dl_info.dli_fname, resolved_path))
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 99
Quoted 4 lines
liblttng-ust-baddr/lttng-ust-baddr.c +4
-0+return 0 ; + }else { +/* +* For regular
dl_phdr_info entries we have to check if
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 100
Quoted 1 line
liblttng-ust-baddr/lttng-ust-baddr.c +1
-0+* the path to the shared
object really exists
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 102
Quoted 2 lines
liblttng-ust-baddr/lttng-ust-baddr.c +2
-0+*/ + if
(!realpath(info->dlpi_name, resolved_path)) {
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 103
Quoted 1 line
liblttng-ust-baddr/lttng-ust-baddr.c +1
-0+/* Found
vDSO, put the 'path' into brackets */
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 115
Quoted 12 lines
liblttng-ust-baddr/lttng-ust-baddr.c +12
-0+snprintf (resolved_path,PATH_MAX -1 ,"[%s]" , + info->dlpi_name); + } + } + +if (stat (resolved_path, &sostat)) { + sostat.st_size =0 ; + sostat.st_mtime =-1 ; + } + + tracepoint(ust_baddr_statedump, soinfo, + (struct
lttng_session *) data, base_addr_ptr,
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 119
Quoted 4 lines
liblttng-ust-baddr/lttng-ust-baddr.c +4
-0+ resolved_path, sostat.st_size, sostat.st_mtime); + +/* +* We are only interested in the base
address (lowest virtual
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 120
Quoted 1 line
liblttng-ust-baddr/lttng-ust-baddr.c +1
-0+* address associated with the memory
image), skip the rest
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 131
Quoted 11 lines
liblttng-ust-baddr/lttng-ust-baddr.c +11
-0+*/ +break ; + } +return 0 ; +} + +int +lttng_ust_baddr_statedump (struct lttng_session *session) +{ +/* +* Iterate through the list of currently loaded shared
objects and
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 132
Quoted 1 line
liblttng-ust-baddr/lttng-ust-baddr.c +1
-0+* generate events for loadable segments using
extract_soinfo_events
Quoted 17 lines
liblttng-ust-baddr/lttng-ust-baddr.c +4
-0+*/ +dl_iterate_phdr (extract_soinfo_events, session); +return 0 ; +}liblttng-ust-baddr/ust_baddr_statedump.c new file +6
-0@@ -0,0 +1,21 @@ +/* +* Copyright (C) 2013 Paul Woegerer <[email protected]> +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either
liblttng-ust-baddr/ust_baddr_statedump.c line 16
Quoted 10 lines
liblttng-ust-baddr/ust_baddr_statedump.c new file +10
-0+* version 2.1 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301
Quoted 18 lines
USA
+ */liblttng-ust-baddr/ust_baddr_statedump.c new file +4
-0+ +#define TRACEPOINT_CREATE_PROBES +#define TP_SESSION_CHECK +#include "ust_baddr_statedump.h" liblttng-ust-baddr/ust_baddr_statedump.h new file +4
-0@@ -0,0 +1,60 @@ +#undef TRACEPOINT_PROVIDER +#define TRACEPOINT_PROVIDER ust_baddr_statedump + +#if !defined(_TRACEPOINT_UST_BADDR_STATEDUMP_H) ||
defined(TRACEPOINT_HEADER_MULTI_READ)
liblttng-ust-baddr/ust_baddr_statedump.h
Quoted 10 lines
liblttng-ust-baddr/ust_baddr_statedump.h new file +10
-0+#define _TRACEPOINT_UST_BADDR_STATEDUMP_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* +* Copyright (C) 2013 Paul Woegerer <[email protected]> +* +* Permission is hereby granted, free of charge, to any person
obtaining a
Quoted 2 lines
copy
+ * of this software and associated documentation files (the
"Software"), to
Quoted 2 lines
deal
+ * in the Software without restriction, including without limitation
the
Quoted 2 lines
rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell
Quoted 1 line
+ * copies of the Software, and to permit persons to whom the Software
is
Quoted 3 lines
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
included
Quoted 4 lines
in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS
Quoted 2 lines
OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY,
Quoted 1 line
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL
Quoted 2 lines
THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER
Quoted 1 line
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING
Quoted 2 lines
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN
liblttng-ust-baddr/ust_baddr_statedump.h
Quoted 13 lines
THE
+ * SOFTWARE.
+ */liblttng-ust-baddr/ust_baddr_statedump.h new file +10
-0+ +#include <stdint.h> +#include <unistd.h> +#include <lttng/ust-events.h> + +#define LTTNG_UST_BADDR_STATEDUMP_PROVIDER +#include <lttng/tracepoint.h> + +TRACEPOINT_EVENT(ust_baddr_statedump, soinfo, + TP_ARGS(struct lttng_session *, session, void *, baddr,
const char*,
liblttng-ust/lttng-events.c int lttng_session_enable(struct lttng_session
Quoted 25 lines
sopath,
int64_t, size,int64_t, mtime),liblttng-ust-baddr/ust_baddr_statedump.h new file +19
-0+ TP_FIELDS( + ctf_integer_hex(void *, baddr, baddr) + ctf_string(sopath, sopath) + ctf_integer(int64_t, size, size) + ctf_integer(int64_t, mtime, mtime) + ) +) + +#endif /* _TRACEPOINT_UST_BADDR_STATEDUMP_H */ + +#undef TRACEPOINT_INCLUDE +#define TRACEPOINT_INCLUDE "./ust_baddr_statedump.h" + +/* This part must be outside ifdef protection */ +#include <lttng/tracepoint-event.h> + +#ifdef __cplusplus +} +#endif liblttng-ust/lttng-events.c +0
-0@@ -293,6 +293,8 @@ int lttng_session_enable(struct lttng_session
*session)
liblttng-ust/lttng-events.c int lttng_session_enable(struct lttng_session · line 297
Quoted 5 lines
liblttng-ust/lttng-events.c +2
-0/* Set atomically the state to "active" */ CMM_ACCESS_ONCE (session->active) =1 ;CMM_ACCESS_ONCE (session->been_active) =1 ; + + lttng_ust_sockinfo_session_enabled(session->owner,
session);
Review
Quoted 17 lines
liblttng-ust/lttng-events.c +0
-0end:return ret; }liblttng-ust/lttng-tracer-core.h +3
-0@@ -45,4 +45,7 @@ const char *lttng_ust_obj_get_name(int id);int lttng_get_notify_socket (void *owner); +void lttng_ust_sockinfo_session_enabled (void *owner, +struct lttng_session *session_enabled); +#endif /* _LTTNG_TRACER_CORE_H */ (quoted diff) +0
-0
b/liblttng-ust/lttng-ust-comm.c
Quoted 12 lines
index a6e4ba3..6ef3006 100644
liblttng-ust/lttng-ust-comm.c +1
-0@@ -34,6 +34,7 @@#include <time.h> #include <assert.h> #include <signal.h> +#include <dlfcn.h> #include <urcu/uatomic.h> #include <urcu/futex.h> #include <urcu/compiler.h>
liblttng-ust/lttng-ust-comm.c struct sock_info { · line 113
Quoted 7 lines
liblttng-ust/lttng-ust-comm.c +1
-0@@ -106,6 +107,7 @@ struct sock_info {char wait_shm_path[PATH_MAX ];char *wait_shm_mmap; +struct lttng_session *session_enabled; };/* Socket from app (connect) to session daemon (listen) for
communication */
Quoted 39 lines
liblttng-ust/lttng-ust-comm.c +14
-0@@ -122,6 +124,8 @@ struct sock_info global_apps = { .notify_socket = -1, .wait_shm_path = "/" LTTNG_UST_WAIT_FILENAME, + + .session_enabled = NULL, };/* TODO: allow global_apps_sock_path override */ @@ -135,6 +139,8 @@ struct sock_info local_apps = { .socket = -1, .notify_socket = -1, + + .session_enabled = NULL, };static int wait_poll_fallback;@@ -176,6 +182,7 @@ static const char *cmd_name_mapping[] = {static const char *str_timeout;static int got_timeout_env; +static void *ust_baddr_handle;extern void lttng_ring_buffer_client_overwrite_init (void );extern void lttng_ring_buffer_client_overwrite_rt_init (void );@@ -235,6 +242,39 @@ void print_cmd(int cmd, int handle) }static +void *lttng_ust_baddr_handle (void ) +{ +if (!ust_baddr_handle) { + ust_baddr_handle =dlopen ( +"liblttng-ust-baddr.so.0" ,RTLD_NOW |RTLD_GLOBAL ); +if (ust_baddr_handle ==NULL ) +ERR ("%s" ,dlerror ()); + } +return ust_baddr_handle;
liblttng-ust/lttng-ust-comm.c void print_cmd(int cmd, int handle) · line 263
Quoted 10 lines
liblttng-ust/lttng-ust-comm.c +10
-0+} + +static +int lttng_ust_baddr_statedump (struct lttng_session *session) +{ +static +int (*lttng_ust_baddr_init_fn)(struct lttng_session *); + +if (!lttng_ust_baddr_init_fn) { + void *baddr_handle =
lttng_ust_baddr_handle();
liblttng-ust/lttng-ust-comm.c void print_cmd(int cmd, int handle) · line 265
Quoted 2 lines
liblttng-ust/lttng-ust-comm.c +2
-0+if (baddr_handle) { + lttng_ust_baddr_init_fn =
dlsym(baddr_handle,
liblttng-ust/lttng-ust-comm.c void print_cmd(int cmd, int handle) · line 267
Quoted 2 lines
liblttng-ust/lttng-ust-comm.c +2
-0+ "lttng_ust_baddr_statedump"); + if
(lttng_ust_baddr_init_fn == NULL)
liblttng-ust/lttng-ust-comm.c void print_cmd(int cmd, int handle) · line 268
Quoted 1 line
liblttng-ust/lttng-ust-comm.c +1
-0+ ERR("%s",
dlerror());
Quoted 13 lines
liblttng-ust/lttng-ust-comm.c +9
-0+ } +if (!lttng_ust_baddr_init_fn) +return -1 ; + } + +return lttng_ust_baddr_init_fn (session); +} + +static int setup_local_apps (void ) {const char *home_dir;
liblttng-ust/lttng-ust-comm.c restart: · line 1183
Quoted 1 line
liblttng-ust/lttng-ust-comm.c +0
-0@@ -1143,6 +1183,13 @@ restart: ret =
handle_message(sock_info, sock, &lum);
liblttng-ust/lttng-ust-comm.c restart: · line 1187
Quoted 4 lines
liblttng-ust/lttng-ust-comm.c +2
-0if (ret) {ERR ("Error handling message for %s socket" , sock_info->name); + }else { + struct
lttng_session *session =
liblttng-ust/lttng-ust-comm.c restart: · line 1189
Quoted 2 lines
liblttng-ust/lttng-ust-comm.c +2
-0+ sock_info->session_enabled; + if
(session) {
liblttng-ust/lttng-ust-comm.c void __attribute__((destructor))
Quoted 7 lines
liblttng-ust/lttng-ust-comm.c +3
-0+ sock_info->session_enabled =NULL ; +lttng_ust_baddr_statedump (session); + } }continue ;default :@@ -1379,6 +1426,12 @@ void __attribute__((destructor))
lttng_ust_exit(void)
liblttng-ust/lttng-ust-comm.c void ust_after_fork_child(sigset_t
Quoted 13 lines
liblttng-ust/lttng-ust-comm.c +6
-0* cleanup the threads if there are stalled in a syscall. */ lttng_ust_cleanup (1 ); + +if (ust_baddr_handle) { +int ret =dlclose (ust_baddr_handle); +if (ret) +ERR ("%s" ,dlerror ()); + } }/* @@ -1456,3 +1509,10 @@ void ust_after_fork_child(sigset_t
*restore_sigset)
Quoted 14 lines
liblttng-ust/lttng-ust-comm.c +7
-1ust_after_fork_common (restore_sigset);lttng_ust_init (); } + +void lttng_ust_sockinfo_session_enabled (void *owner, +struct lttng_session *session_enabled) +{ +struct sock_info *sock_info = owner; + sock_info->session_enabled = session_enabled; +} --1.8.4.2
Signature · 24 lines
Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com _______________________________________________ lttng-dev mailing list [email protected] http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20131117/1387c63e/attachment.html> ------------------------------ _______________________________________________ lttng-dev mailing list [email protected] http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev End of lttng-dev Digest, Vol 67, Issue 48 *****************************************
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: Questions about JUL (was: lttng-dev Digest, Vol 67, Issue 48)
Hi Jim,
I'm CCing David on this one. He will answer as soon we he gets back from FOSDEM (and recovers from jet lag). ;-)
Note to Daniel: please don't reply to a mailing list digest. It's a very good way to have an email ignored as "TL;DR".
Thanks!
Mathieu
----- Original Message -----
Quoted 18 lines
From: "Jim Dumont" <[email protected]>
To: [email protected]
Sent: Friday, January 17, 2014 12:26:13 PM
Subject: Re: [lttng-dev] lttng-dev Digest, Vol 67, Issue 48Hi there,
Was there a follow-up to the series of questions raised by Daniel below and referenced here:
http://lists.lttng.org/pipermail/lttng-dev/2013-November/021844.html
I didn't see one in the mailing list.
BR,
/Jim
[...]
Quoted 81 lines
----------------------------------------------------------------------
Message: 1
Date: Fri, 15 Nov 2013 20:22:34 +0000
From: "Thibault, Daniel" <[email protected]>
To: "[email protected]" <[email protected]>
Subject: Re: [lttng-dev] [RELEASE] LTTng-Tools 2.4.0-rc1 - ?poque
Opaque
Message-ID:<48CF5AC71E61DB46B70D0F388054EFFD267A2503@VAL-E-01.valcartier.drdc-rddc.gc.ca>Content-Type: text/plain; charset="iso-8859-1"
-----Message d'origine-----
Date: Fri, 15 Nov 2013 12:27:01 -0500
From: David Goulet <[email protected]>Quoted 8 lines
1) Live support. It's now possible to stream traces (kernel and UST) while they being extracted meaning a relayd can now receive traces live and a viewer can attach to it to process the trace while running. The "--live" has been added to lttng create command that sets up a live tracing session.
See
doc/live-reading-howto.txtanddoc/live-reading-protocol.txtfor more detail on that feature.Does this mean you can't do a "live" trace to local storage?
Quoted 9 lines
2) Java Util Logging support. With a special LTTngAgent located in lttng-ust project (liblttng-ust-jul) to trace JUL events and gather UST traces with them.
The -j/--jul domain has been added to lttng command line so you can list the possible JUL Logger object and enable/disable them. It is the same as using the UST or Kernel domain.
As of now, filters and loglevel are ignored with the JUL domain.
Saying "It is the same as using the UST or Kernel domain" leaves a lot of questions unanswered, since the kernel and user-space behave *very* differently on a lot of points.
1) Does --jul require root privileges?
2) I suppose the various commands have --kernel pre-empting --userspace pre-empting --ul?
3) add-context: does --jul have the same possible context types as --userspace (i.e. ip,pthread_id, procname, vpid, vtid)?
4) enable-channel:
4.1) Are the --jul --subbuf-size, --num-subbuf and --read-timer defaults the same as with --userspace?
4.2) Presumably --output can only be mmap?
4.3) Are the --jul buffering schemes the same as with --userspace (i.e. --buffers-pid and --buffers-uid)?
4.4) If yes, won't they all degenerate to the virtual machine's user and process IDs?
5) enable-event:
5.1) Can you assign --jul events to multiple channels like you can in --userspace?
5.2) Is the --jul event type --tracepoint or something else entirely? 5.3) Can the trailing wild card (and exclusion option) be used in the event name when enabling/disabling --jul events?
6) list: Does bug #654 also apply to --jul?Daniel U. Thibault
Protection des syst?mes et contremesures (PSC) | Systems Protection & Countermeasures (SPC) Cyber s?curit? pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS) R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) | Defence R&D Canada - Valcartier (DRDC Valcartier)
2459 route de la Bravoure
Qu?bec QC G3J 1X5
CANADA
Vox : (418) 844-4000 x4245
Fax : (418) 844-4538
NAC : 918V QSDJ <http://www.travelgis.com/map.asp?addr=918V%20QSDJ>
Gouvernement du Canada | Government of Canada
<http://www.valcartier.drdc-rddc.gc.ca/>
Signature · 3 lines
Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com
Quoted 19 lines · Jim Dumont
Hi there,
Was there a follow-up to the series of questions raised by Daniel below and referenced here:
http://lists.lttng.org/pipermail/lttng-dev/2013-November/021844.html
I didn't see one in the mailing list.
BR,
/Jim
Quoted 6 lines
1) Live support. It's now possible to stream traces (kernel and UST) while they being extracted meaning a relayd can now receive traces live and a viewer can attach to it to process the trace while running. The "--live" has been added to lttng create command that sets up a live tracing session.
Quoted 4 lines
Quoted 2 lines
See
doc/live-reading-howto.txtanddoc/live-reading-protocol.txtfor more detail on that feature.Does this mean you can't do a "live" trace to local storage?
You can use local storage for the live feature BUT you always need a relayd thus there will be some streaming happening on the loopback interface.
However, you *can't* start a live viewer by directly pointing to a trace on disk. It may works but we do NOT recommend it since you'll probably end up in a bad state or have synchronization issue.
Quoted 9 lines
Quoted 9 lines
2) Java Util Logging support. With a special LTTngAgent located in lttng-ust project (liblttng-ust-jul) to trace JUL events and gather UST traces with them.
The -j/--jul domain has been added to lttng command line so you can list the possible JUL Logger object and enable/disable them. It is the same as using the UST or Kernel domain.
Quoted 5 lines
Quoted 1 line
As of now, filters and loglevel are ignored with the JUL domain.
Saying "It is the same as using the UST or Kernel domain" leaves a lot of questions unanswered, since the kernel and user-space behave *very* differently on a lot of points.
1) Does --jul require root privileges?
No. JUL actually acts exactly like UST since it uses it thus a Java application connect to the session daemon that it can talk to.
Quoted 1 line
2) I suppose the various commands have --kernel pre-empting --userspace pre-empting --ul?
Yup. This is actually not mention anywhere but looking at "lttng" command line code, the domain's order is: kernel, ust, jul. Probably we should actually output an error if the user uses multiple domain...
Quoted 1 line
3) add-context: does --jul have the same possible context types as --userspace (i.e. ip,
pthread_id, procname, vpid, vtid)?
Nope.
Quoted 2 lines
4) enable-channel:
4.1) Are the --jul --subbuf-size, --num-subbuf and --read-timer defaults the same as with --userspace?
Nope. JUL uses it's internal channel so basically enable channel does NOT support the jul domain thus not having -j in the help/man.
Quoted 1 line
4.2) Presumably --output can only be mmap?
Yes. Same as UST but again you can't use enable-channel with JUl domain.
Quoted 1 line
4.3) Are the --jul buffering schemes the same as with --userspace (i.e. --buffers-pid and --buffers-uid)?
Always per UID. You can't change it.
Quoted 1 line
4.4) If yes, won't they all degenerate to the virtual machine's user and process IDs?
Not sure I understand this one?
Quoted 2 lines
5) enable-event:
5.1) Can you assign --jul events to multiple channels like you can in --userspace?
No.
Quoted 1 line
5.2) Is the --jul event type --tracepoint or something else entirely?
It is tracepoint yes. For the JUL domain, ALL UST tracepoints are enabled (there is only one for now with the lttng-ust library we use (liblttng-ust-jul)).
Quoted 1 line
5.3) Can the trailing wild card (and exclusion option) be used in the event name when enabling/disabling --jul events?
Wild card are NOT supported for the JUL domain. Thus for instance "lttng enable-event -j my_event_subsystem42_*" will not work. Only the "*" will work enabling every Loggers.
Quoted 1 line
6) list: Does bug #654 also apply to --jul?
Yes most probably. The session name is ignored.
Now after answering all this, I feel like either creating a lttng-jul man page or adding a special section in "lttng.1" for the JUL domain explaining all this. Thoughts?
Cheers!
David
Quoted 113 lines
Daniel U. Thibault
Protection des syst?mes et contremesures (PSC) | Systems Protection & Countermeasures (SPC) Cyber s?curit? pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS) R & D pour la d?fense Canada - Valcartier (RDDC Valcartier) | Defence R&D Canada - Valcartier (DRDC Valcartier) 2459 route de la Bravoure
Qu?bec QC G3J 1X5
CANADA
Vox : (418) 844-4000 x4245
Fax : (418) 844-4538
NAC : 918V QSDJ <http://www.travelgis.com/map.asp?addr=918V%20QSDJ>
Gouvernement du Canada | Government of Canada <http://www.valcartier.drdc-rddc.gc.ca/>------------------------------
Message: 2
Date: Fri, 15 Nov 2013 21:10:00 +0000 (UTC)
From: Mathieu Desnoyers <[email protected]>
To: lttng-dev <[email protected]>
Subject: [lttng-dev] [RELEASE] LTTng-UST 2.4.0-rc1 Message-ID:<[email protected]>Content-Type: text/plain; charset=utf-8
LTTng-UST, the Linux Trace Toolkit Next Generation Userspace Tracer, is port of the low-overhead tracing capabilities of the LTTng kernel tracer to user-space. The library "liblttng-ust" enables tracing of applications and libraries.
Main changes: Java Util Logging support, live streaming support, event "excluders" (courtesy of Mentor), base address tracing for symbol lookup (courtesy of Mentor).
Changelog:
2013-11-15 lttng-ust 2.4.0-rc1
* doc/examples: error out when a subdir make fails
* JUL: fix out of tree build
* Java/jul: fix make dist
* JUL: install documentation and jar file
* Add missing copyrights to test scripts
* Escape minus signs in lttng-ust-cyg-profile manpage
* Fix spelling mistake in lttng-ust manpage
* Fix tests/benchmark
* Implement base-address-state tracing
* Base-address tracing for dlopen and dlclose
* Add a check against excluders
* Add handler forLTTNG_UST_EXCLUSIONin UST ABI
* Store exclusions to enablers
* Add excluders to enabler structure
* Send exclusion data through ustcomm
* Define exclusion structure for UST ABI
* Define a new commandLTTNG_UST_EXCLUSION
* Fix: package ofLTTngUst.hwas renamed without renaming target in makefile
* Fix: check for java .class in package subfolders
* Fix: java library to use user define JDK at compile time
* Add liblttng-ust-jul for JUL support
* Fix: application SIGBUS when starting in parallel with sessiond
* Fix: Minor corrections to the lttng-ust man page
* Documentation cleanup: Overhaul of the lttng-gen-tp man page
* Warning cleanup: add missing padding initializer
* Fix: socket connect hang on heavy loads
* Cleanup: fix typo
* Fix: ust-comm recvmsg should handle partial receive
* gcc warning fix: -Wextra
* Add usage reference count for tracepoints
*tracepoint.c: Move add_callsite/remove_callsite further down in file
* Store the callsites into the library callsite list
* Fix linking warning
* Per-stream ioctl to get the current timestamp
* LTTng ringbuffer ABI calls for index generation
* Specializelttng_ust_lib_ring_buffer_client_cb
* Add tracing instrumentation for pthread mutex lock functionsProject website: http://lttng.org
Download link: http://lttng.org/download (please refer to the README file for installation instructions)--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com------------------------------
Message: 3
Date: Fri, 15 Nov 2013 21:12:06 +0000 (UTC)
From: Mathieu Desnoyers <[email protected]>
To: lttng-dev <[email protected]>
Subject: [lttng-dev] [RELEASE] LTTng modules 2.4.0-rc1 Message-ID:<[email protected]>Content-Type: text/plain; charset=utf-8
The LTTng modules provide Linux kernel tracing capability to the LTTng 2.x tracer toolset.
Major changes: live streaming support, index generation by consumerd support, 3.12 Linux kernel support.
Changelog:
2013-11-15 LTTng modules 2.4.0-rc1
* Update ext4 instrumentation to Linux 3.12
* Update RCU instrumentation to Linux 3.12
* Update btrfs instrumentation to 3.12 kernel
* Update vmscan instrumentation to Linux 3.12
* update: kmem instrumentation 3.12 kernel support
* lttng-statedump-impl: Use generic hard irqs for Linux >= 3.12
* lttng-statedump-impl: Fixlttng_list_interruptsfor empty implementation
* Import fix from LTSI: 3.4+ RT kernels useCONFIG_PREEMPT_RT_FULL
* Add new tracepoint in KVM
* Blacklist kernels 3.10.13 and 3.11.2
* LTTng trace-clock: shrink kernel blacklist
* Metadata flush writes data from the cache
* Per-stream ioctl to get the current timestamp
* LTTng ringbuffer ABI calls for index generation
* Prepare LTTng override of ring buffer fops
* Blacklist Linux kernels 3.10+
Quoted 656 lines
Project website: http://lttng.org
Download link: http://lttng.org/download
(please refer to the README files for installation instructions and lttng-toolsdoc/quickstart.txtfor usage information)Signature · 17 lines
Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com ------------------------------ Message: 4 Date: Sat, 16 Nov 2013 08:42:15 -0500 From: David Goulet <[email protected]> To: ??? <[email protected]> Cc: lttng-dev <[email protected]> Subject: Re: [lttng-dev] ??? how does ust tracer map share lttng buffer Message-ID: <20131116134215.GA7300@thessa> Content-Type: text/plain; charset="utf-8"Quoted 4 lines · ???
Quoted 1 line
Indeed, from a sessiond point of view, this will typically use the same FD number, but it's really associated with a different posix SHM each time.
Yes,what confused me the most is that sessiond sends the same FD number to UST every time,but UST receives the different FD number each time and can map it to the right per-cpu share buffer sucessfully.
Yes, in per UID buffers, for every application using UST we send the FD corresponding to the already allocated buffer (being per UID).
Please note that sending a FD through a Unix socket dups it so basically UST receives that, access the shared memory buffer and can then operate correctly.
Cheers!
DavidQuoted 41 lines
Thanks
MuXiu.CaoFrom: "???" <[email protected]>
To: "mathieu.desnoyers" <[email protected]>
Sent: Friday, November 15, 2013 11:37:11 AM
Subject: how does ust tracer map share lttng bufferHi,Mathieu
After lttng sub-command enable-event is issued at first time, lttng-consumerd will be informed by lttng-sessiond to open and mmap share memory regions .Then lttng-sessiond get all shmfds from lttng-consumerd.But how does ust tracer map to these share memory regions?
AFAIK,lttng-sessiond will call
do_consumer_create_channel(),thensend_channel_uid_to_ust(). What's confused me is in send_channel_uid_to_ust(),lttng-sessionddup()one shmfd , thenust_consumer_send_stream_to_ust()to ust tracer, then close the shmfd and loop all shmfds. So all duped fds are the same fd-number (say A)and send to ust tracer through ust_consumer_send_stream_to_ust()->ustctl_send_stream_to_ust()->ustctl_send_stream()->ustcomm_send_fds_unix_sock()(unix socket is $HOME/.lttng/lttng-ust-sock-5).Why does it send the same fds to ust tracer? At ust tracer side,it calls handle_message()->ustcomm_recv_stream_from_sessiond() and mmap every received fd to share memory region.However,every received fd is different from A.So I must miss something anywhere.How does ust tracer map share lttng buffer?In lttng-sessiond, we send file descriptors for each posix SHM associated to every per-cpu buffer to the application over unix socket. So it's more or less : receive FD from consumer, send FD over unix socket to UST, close FD (we loop on this). Indeed, from a sessiond point of view, this will typically use the same FD number, but it's really associated with a different posix SHM each time. David can probably answer your question in more detail.
Thanks,
Mathieu
Quoted 17 lines
PS:code is from lttng-2.3.0 .
Thanks
MuXiu.CaoSignature · 3 lines
Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: Digital signature
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20131116/afbf97a4/attachment-0001.pgp>------------------------------
Message: 5
Date: Sun, 17 Nov 2013 11:36:19 +0200
From: Amit Margalit <[email protected]>
To: Mathieu Desnoyers <[email protected]>
Cc: [email protected]
Subject: Re: [lttng-dev] [PATCH v3 2/2] Implement base-address-state
tracing
Message-ID:<OF5EA7C09A.2F75FE97-ONC2257C26.00348FD3-C2257C26.0034C2F3@il.ibm.com>Content-Type: text/plain; charset="us-ascii"
I guess I missed something in the discussion - is this going to be active all the time, or can I disable it somehow?
Maybe a command-line switch to turn this off?
For me this is overhead that I don't need and don't want.
Thanks,
Amit Margalit
IBM XIV - Storage Reinvented
XIV-NAS Development Team
Tel. 03-689-7774
Fax. 03-689-7230From: Mathieu Desnoyers <[email protected]> To: Paul Woegerer <[email protected]>Date: 11/14/2013 09:30 PM Subject: Re: [lttng-dev] [PATCH v3 2/2] Implementbase-address-state tracing
----- Original Message -----
Quoted 2 lines
From: "Paul Woegerer" <[email protected]>
To: [email protected], "mathieu desnoyers"Quoted 5 lines
Sent: Thursday, November 14, 2013 1:39:49 PM
Subject: [PATCH v3 2/2] Implement base-address-state tracingDump the base-address state (executable and shared objects) into session on session-enable (per-session events).
Merged, thanks !
Mathieu
Quoted 9 lines
Signed-off-by Paul Woegerer <[email protected]>--- include/lttng/ust-tracepoint-event.h | 14 +++++++ liblttng-ust-baddr/Makefile.am | 4 +- liblttng-ust-baddr/lttng-ust-baddr.c | 72 ++++++++++++++++++++++++++++++++ liblttng-ust-baddr/ust_baddr_statedump.c | 21 ++++++++++ liblttng-ust-baddr/ust_baddr_statedump.h | 60++++++++++++++++++++++++++
Quoted 3 lines
liblttng-ust/lttng-events.c | 2 + liblttng-ust/lttng-tracer-core.h | 3 ++ liblttng-ust/lttng-ust-comm.c | 60++++++++++++++++++++++++++
Quoted 10 lines
8 files changed, 235 insertions(+), 1 deletion(-) create mode 100644 liblttng-ust-baddr/ust_baddr_statedump.c create mode 100644 liblttng-ust-baddr/ust_baddr_statedump.hinclude/lttng/ust-tracepoint-event.h +0
-0include/lttng/ust-tracepoint-event.h size_t · line 484
Quoted 5 lines
include/lttng/ust-tracepoint-event.h +1
-0@@ -480,6 +480,18 @@ size_t __event_get_align__##_provider##___##_name(_TP_ARGS_PROTO(_args)) \#define TP_FIELDS (...) __VA_ARGS__/* +* For state dump, check that "session" argument (mandatory) matches the
include/lttng/ust-tracepoint-event.h size_t · line 485
Quoted 1 line
include/lttng/ust-tracepoint-event.h +1
-0+* session this event belongs to. Ensures that we write state dump data only
Quoted 14 lines
include/lttng/ust-tracepoint-event.h +10
-0+* into the started session, not into all sessions. +*/ +#undef _TP_SESSION_CHECK +#ifdef TP_SESSION_CHECK +#define _TP_SESSION_CHECK (session, csession) (session == csession) +#else /* TP_SESSION_CHECK */ +#define _TP_SESSION_CHECK (session, csession) 1 +#endif /* TP_SESSION_CHECK */ + +/* * Using twice size for filter stack data to hold size and pointer for * each field (worse case). For integers, max size required is 64-bit. * Same for double-precision floats. Those fit within
include/lttng/ust-tracepoint-event.h void · line 521
Quoted 4 lines
include/lttng/ust-tracepoint-event.h +0
-0@@ -506,6 +518,8 @@ void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args)) \ \ if (0) \ (void) __dynamic_len_idx; /* don't warnif unused */ \
include/lttng/ust-tracepoint-event.h void · line 524
Quoted 3 lines
include/lttng/ust-tracepoint-event.h +2
-0+if (!_TP_SESSION_CHECK (session, __chan->session)) \ +return ; \ if(caa_unlikely(!CMM_ACCESS_ONCE(__chan->session->active))) \
Review
Quoted 3 lines
include/lttng/ust-tracepoint-event.h +0
-0return ; \if (caa_unlikely(!CMM_ACCESS_ONCE(__chan->enabled))) \(quoted diff) +0
-0b/liblttng-ust-baddr/Makefile.am
Quoted 28 lines
index afa9489..0d3cf28 100644
liblttng-ust-baddr/Makefile.am +3
-1@@ -5,7 +5,9 @@ lib_LTLIBRARIES = liblttng-ust-baddr.la liblttng_ust_baddr_la_SOURCES = \ lttng-ust-baddr.c \ ust_baddr.c \ - ust_baddr.h + ust_baddr.h \ + ust_baddr_statedump.c \ + ust_baddr_statedump.h liblttng_ust_baddr_la_LIBADD = \ -L$(top_builddir)/liblttng-ust/.libs \ -llttng-ustliblttng-ust-baddr/lttng-ust-baddr.c +1
-0@@ -34,6 +34,7 @@#define TRACEPOINT_DEFINE #include "ust_baddr.h" +#include "ust_baddr_statedump.h" int lttng_ust_push_baddr (void *so_base,const char *so_name)liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 68
Quoted 6 lines
liblttng-ust-baddr/lttng-ust-baddr.c +3
-0@@ -62,3 +63,74 @@ lttng_ust_pop_baddr(void *so_base)tracepoint (ust_baddr, pop, so_base);return 0 ; } + +static int +extract_soinfo_events(struct dl_phdr_info *info, size_t size, void*data)
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 81
Quoted 13 lines
liblttng-ust-baddr/lttng-ust-baddr.c +13
-0+{ +int j; +int num_loadable_segment =0 ; + +for (j =0 ; j < info->dlpi_phnum; j++) { +char resolved_path[PATH_MAX ]; +struct stat sostat; +void *base_addr_ptr; + +if (info->dlpi_phdr[j].p_type !=PT_LOAD ) +continue ; + +/* Calculate virtual memory address of the loadable segment */
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 83
Quoted 2 lines
liblttng-ust-baddr/lttng-ust-baddr.c +2
-0+ base_addr_ptr = (void *) info->dlpi_addr + +info->dlpi_phdr[j].p_vaddr;
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 86
Quoted 3 lines
liblttng-ust-baddr/lttng-ust-baddr.c +3
-0+ + num_loadable_segment +=1 ; + if ((info->dlpi_name == NULL ||info->dlpi_name[0] == 0)
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 87
Quoted 1 line
liblttng-ust-baddr/lttng-ust-baddr.c +1
-0+ &&
num_loadable_segment== 1) {liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 89
Quoted 2 lines
liblttng-ust-baddr/lttng-ust-baddr.c +2
-0+/* +* If the iterated element is the executable itself we
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 90
Quoted 1 line
liblttng-ust-baddr/lttng-ust-baddr.c +1
-0+* have to use Dl_info to determine its full path
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 93
Quoted 3 lines
liblttng-ust-baddr/lttng-ust-baddr.c +3
-0+*/ +Dl_info dl_info = {0 }; + if(!dladdr(base_addr_ptr,
&dl_info))liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 95
Quoted 2 lines
liblttng-ust-baddr/lttng-ust-baddr.c +2
-0+return 0 ; + if(!realpath(dl_info.dli_fname,
resolved_path))liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 99
Quoted 4 lines
liblttng-ust-baddr/lttng-ust-baddr.c +4
-0+return 0 ; + }else { +/* +* For regular
dl_phdr_infoentries we have to check ifliblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 100
Quoted 1 line
liblttng-ust-baddr/lttng-ust-baddr.c +1
-0+* the path to the shared object really exists
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 102
Quoted 2 lines
liblttng-ust-baddr/lttng-ust-baddr.c +2
-0+*/ + if(!realpath(info->dlpi_name,
resolved_path)) {liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 103
Quoted 1 line
liblttng-ust-baddr/lttng-ust-baddr.c +1
-0+/* Found vDSO, put the 'path' into brackets */
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 115
Quoted 12 lines
liblttng-ust-baddr/lttng-ust-baddr.c +12
-0+snprintf (resolved_path,PATH_MAX -1 ,"[%s]" , + info->dlpi_name); + } + } + +if (stat (resolved_path, &sostat)) { + sostat.st_size =0 ; + sostat.st_mtime =-1 ; + } + + tracepoint(ust_baddr_statedump, soinfo, + (struct
lttng_session*) data,base_addr_ptr,liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 119
Quoted 4 lines
liblttng-ust-baddr/lttng-ust-baddr.c +4
-0+ resolved_path, sostat.st_size, sostat.st_mtime); + +/* +* We are only interested in the base address (lowest virtual
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 120
Quoted 1 line
liblttng-ust-baddr/lttng-ust-baddr.c +1
-0+* address associated with the memory image), skip the rest
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 131
Quoted 11 lines
liblttng-ust-baddr/lttng-ust-baddr.c +11
-0+*/ +break ; + } +return 0 ; +} + +int +lttng_ust_baddr_statedump (struct lttng_session *session) +{ +/* +* Iterate through the list of currently loaded shared objects and
liblttng-ust-baddr/lttng-ust-baddr.c lttng_ust_pop_baddr(void *so_base) · line 132
Quoted 1 line
liblttng-ust-baddr/lttng-ust-baddr.c +1
-0+* generate events for loadable segments using
extract_soinfo_eventsQuoted 17 lines
liblttng-ust-baddr/lttng-ust-baddr.c +4
-0+*/ +dl_iterate_phdr (extract_soinfo_events, session); +return 0 ; +}liblttng-ust-baddr/ust_baddr_statedump.c new file +6
-0@@ -0,0 +1,21 @@ +/* +* Copyright (C) 2013 Paul Woegerer <[email protected]> +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either liblttng-ust-baddr/ust_baddr_statedump.c line 16
Quoted 10 lines
liblttng-ust-baddr/ust_baddr_statedump.c new file +10
-0+* version 2.1 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
Quoted 18 lines
USA
+ */liblttng-ust-baddr/ust_baddr_statedump.c new file +4
-0+ +#define TRACEPOINT_CREATE_PROBES +#define TP_SESSION_CHECK +#include "ust_baddr_statedump.h" liblttng-ust-baddr/ust_baddr_statedump.h new file +4
-0@@ -0,0 +1,60 @@ +#undef TRACEPOINT_PROVIDER +#define TRACEPOINT_PROVIDER ust_baddr_statedump + +#if !defined(_TRACEPOINT_UST_BADDR_STATEDUMP_H) ||
defined(TRACEPOINT_HEADER_MULTI_READ)liblttng-ust-baddr/ust_baddr_statedump.h
Quoted 10 lines
liblttng-ust-baddr/ust_baddr_statedump.h new file +10
-0+#define _TRACEPOINT_UST_BADDR_STATEDUMP_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* +* Copyright (C) 2013 Paul Woegerer <[email protected]> +* +* Permission is hereby granted, free of charge, to any person obtaining a
Quoted 2 lines
copy
+ * of this software and associated documentation files (the"Software"), to
Quoted 2 lines
deal
+ * in the Software without restriction, including without limitationthe
Quoted 2 lines
rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/orsell
Quoted 1 line
+ * copies of the Software, and to permit persons to whom the Software
is
Quoted 3 lines
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall beincluded
Quoted 4 lines
in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,EXPRESS
Quoted 2 lines
OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OFMERCHANTABILITY,
Quoted 1 line
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL
Quoted 2 lines
THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OROTHER
Quoted 1 line
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING
Quoted 2 lines
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHERDEALINGS IN
liblttng-ust-baddr/ust_baddr_statedump.h
Quoted 13 lines
THE
+ * SOFTWARE.
+ */liblttng-ust-baddr/ust_baddr_statedump.h new file +10
-0+ +#include <stdint.h> +#include <unistd.h> +#include <lttng/ust-events.h> + +#define LTTNG_UST_BADDR_STATEDUMP_PROVIDER +#include <lttng/tracepoint.h> + +TRACEPOINT_EVENT(ust_baddr_statedump, soinfo, + TP_ARGS(struct lttng_session *, session, void *, baddr,const char*,
liblttng-ust/lttng-events.c int lttng_session_enable(struct lttng_session
Quoted 25 lines
sopath,
int64_t, size,int64_t, mtime),liblttng-ust-baddr/ust_baddr_statedump.h new file +19
-0+ TP_FIELDS( + ctf_integer_hex(void *, baddr, baddr) + ctf_string(sopath, sopath) + ctf_integer(int64_t, size, size) + ctf_integer(int64_t, mtime, mtime) + ) +) + +#endif /* _TRACEPOINT_UST_BADDR_STATEDUMP_H */ + +#undef TRACEPOINT_INCLUDE +#define TRACEPOINT_INCLUDE "./ust_baddr_statedump.h" + +/* This part must be outside ifdef protection */ +#include <lttng/tracepoint-event.h> + +#ifdef __cplusplus +} +#endif liblttng-ust/lttng-events.c +0
-0@@ -293,6 +293,8 @@ int lttng_session_enable(struct lttng_session*session)
liblttng-ust/lttng-events.c int lttng_session_enable(struct lttng_session · line 297
Quoted 5 lines
liblttng-ust/lttng-events.c +2
-0/* Set atomically the state to "active" */ CMM_ACCESS_ONCE (session->active) =1 ;CMM_ACCESS_ONCE (session->been_active) =1 ; + + lttng_ust_sockinfo_session_enabled(session->owner,session);
Review
Quoted 17 lines
liblttng-ust/lttng-events.c +0
-0end:return ret; }liblttng-ust/lttng-tracer-core.h +3
-0@@ -45,4 +45,7 @@ const char *lttng_ust_obj_get_name(int id);int lttng_get_notify_socket (void *owner); +void lttng_ust_sockinfo_session_enabled (void *owner, +struct lttng_session *session_enabled); +#endif /* _LTTNG_TRACER_CORE_H */ (quoted diff) +0
-0
b/liblttng-ust/lttng-ust-comm.cQuoted 12 lines
index a6e4ba3..6ef3006 100644
liblttng-ust/lttng-ust-comm.c +1
-0@@ -34,6 +34,7 @@#include <time.h> #include <assert.h> #include <signal.h> +#include <dlfcn.h> #include <urcu/uatomic.h> #include <urcu/futex.h> #include <urcu/compiler.h> liblttng-ust/lttng-ust-comm.c struct sock_info { · line 113
Quoted 7 lines
liblttng-ust/lttng-ust-comm.c +1
-0@@ -106,6 +107,7 @@ struct sock_info {char wait_shm_path[PATH_MAX ];char *wait_shm_mmap; +struct lttng_session *session_enabled; };/* Socket from app (connect) to session daemon (listen) for communication */
Quoted 39 lines
liblttng-ust/lttng-ust-comm.c +14
-0@@ -122,6 +124,8 @@ struct sock_info global_apps = { .notify_socket = -1, .wait_shm_path = "/" LTTNG_UST_WAIT_FILENAME, + + .session_enabled = NULL, };/* TODO: allow global_apps_sock_path override */ @@ -135,6 +139,8 @@ struct sock_info local_apps = { .socket = -1, .notify_socket = -1, + + .session_enabled = NULL, };static int wait_poll_fallback;@@ -176,6 +182,7 @@ static const char *cmd_name_mapping[] = {static const char *str_timeout;static int got_timeout_env; +static void *ust_baddr_handle;extern void lttng_ring_buffer_client_overwrite_init (void );extern void lttng_ring_buffer_client_overwrite_rt_init (void );@@ -235,6 +242,39 @@ void print_cmd(int cmd, int handle) }static +void *lttng_ust_baddr_handle (void ) +{ +if (!ust_baddr_handle) { + ust_baddr_handle =dlopen ( +"liblttng-ust-baddr.so.0" ,RTLD_NOW |RTLD_GLOBAL ); +if (ust_baddr_handle ==NULL ) +ERR ("%s" ,dlerror ()); + } +return ust_baddr_handle;liblttng-ust/lttng-ust-comm.c void print_cmd(int cmd, int handle) · line 263
Quoted 10 lines
liblttng-ust/lttng-ust-comm.c +10
-0+} + +static +int lttng_ust_baddr_statedump (struct lttng_session *session) +{ +static +int (*lttng_ust_baddr_init_fn)(struct lttng_session *); + +if (!lttng_ust_baddr_init_fn) { + void *baddr_handle =
lttng_ust_baddr_handle();liblttng-ust/lttng-ust-comm.c void print_cmd(int cmd, int handle) · line 265
Quoted 2 lines
liblttng-ust/lttng-ust-comm.c +2
-0+if (baddr_handle) { + lttng_ust_baddr_init_fn =dlsym(baddr_handle,
liblttng-ust/lttng-ust-comm.c void print_cmd(int cmd, int handle) · line 267
Quoted 2 lines
liblttng-ust/lttng-ust-comm.c +2
-0+ "lttng_ust_baddr_statedump"); + if(
lttng_ust_baddr_init_fn== NULL)liblttng-ust/lttng-ust-comm.c void print_cmd(int cmd, int handle) · line 268
Quoted 1 line
liblttng-ust/lttng-ust-comm.c +1
-0+ ERR("%s",
dlerror());Quoted 13 lines
liblttng-ust/lttng-ust-comm.c +9
-0+ } +if (!lttng_ust_baddr_init_fn) +return -1 ; + } + +return lttng_ust_baddr_init_fn (session); +} + +static int setup_local_apps (void ) {const char *home_dir;liblttng-ust/lttng-ust-comm.c restart: · line 1183
Quoted 1 line
liblttng-ust/lttng-ust-comm.c +0
-0@@ -1143,6 +1183,13 @@ restart: ret =
handle_message(sock_info, sock, &lum);liblttng-ust/lttng-ust-comm.c restart: · line 1187
Quoted 4 lines
liblttng-ust/lttng-ust-comm.c +2
-0if (ret) {ERR ("Error handling message for %s socket" , sock_info->name); + }else { + struct
lttng_session*session =liblttng-ust/lttng-ust-comm.c restart: · line 1189
Quoted 2 lines
liblttng-ust/lttng-ust-comm.c +2
-0+ sock_info->session_enabled; + if(session) {
liblttng-ust/lttng-ust-comm.c void __attribute__((destructor))
Quoted 7 lines
liblttng-ust/lttng-ust-comm.c +3
-0+ sock_info->session_enabled =NULL ; +lttng_ust_baddr_statedump (session); + } }continue ;default :@@ -1379,6 +1426,12 @@ void __attribute__((destructor))
lttng_ust_exit(void)liblttng-ust/lttng-ust-comm.c void ust_after_fork_child(sigset_t
Quoted 13 lines
liblttng-ust/lttng-ust-comm.c +6
-0* cleanup the threads if there are stalled in a syscall. */ lttng_ust_cleanup (1 ); + +if (ust_baddr_handle) { +int ret =dlclose (ust_baddr_handle); +if (ret) +ERR ("%s" ,dlerror ()); + } }/* @@ -1456,3 +1509,10 @@ void ust_after_fork_child(sigset_t
*restore_sigset)Quoted 14 lines
liblttng-ust/lttng-ust-comm.c +7
-1ust_after_fork_common (restore_sigset);lttng_ust_init (); } + +void lttng_ust_sockinfo_session_enabled (void *owner, +struct lttng_session *session_enabled) +{ +struct sock_info *sock_info = owner; + sock_info->session_enabled = session_enabled; +} --1.8.4.2
Signature · 29 lines
Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com _______________________________________________ lttng-dev mailing list [email protected] http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20131117/1387c63e/attachment.html> ------------------------------ _______________________________________________ lttng-dev mailing list [email protected] http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev End of lttng-dev Digest, Vol 67, Issue 48 ***************************************** _______________________________________________ lttng-dev mailing list [email protected] http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
A message that is not in the archive (sent off-list or not yet received): 20140204171736.GE7182@thessa
----- Original Message -----
Quoted 112 lines
From: "David Goulet" <[email protected]>
To: "Jim Dumont" <[email protected]>
Cc: [email protected]
Sent: Tuesday, February 4, 2014 12:17:36 PM
Subject: Re: [lttng-dev] lttng-dev Digest, Vol 67, Issue 48Quoted 20 lines · Jim Dumont
Hi there,
Was there a follow-up to the series of questions raised by Daniel below and referenced here:
http://lists.lttng.org/pipermail/lttng-dev/2013-November/021844.html
I didn't see one in the mailing list.
BR,
/Jim
Quoted 6 lines
1) Live support. It's now possible to stream traces (kernel and UST) while they being extracted meaning a relayd can now receive traces live and a viewer can attach to it to process the trace while running. The "--live" has been added to lttng create command that sets up a live tracing session.
Quoted 4 lines
Quoted 2 lines
See
doc/live-reading-howto.txtanddoc/live-reading-protocol.txtfor more detail on that feature.Does this mean you can't do a "live" trace to local storage?
You can use local storage for the live feature BUT you always need a relayd thus there will be some streaming happening on the loopback interface.
However, you *can't* start a live viewer by directly pointing to a trace on disk. It may works but we do NOT recommend it since you'll probably end up in a bad state or have synchronization issue.
Quoted 9 lines
Quoted 9 lines
2) Java Util Logging support. With a special LTTngAgent located in lttng-ust project (liblttng-ust-jul) to trace JUL events and gather UST traces with them.
The -j/--jul domain has been added to lttng command line so you can list the possible JUL Logger object and enable/disable them. It is the same as using the UST or Kernel domain.
Quoted 7 lines
Quoted 1 line
As of now, filters and loglevel are ignored with the JUL domain.
Saying "It is the same as using the UST or Kernel domain" leaves a lot of questions unanswered, since the kernel and user-space behave *very* differently on a lot of points.
1) Does --jul require root privileges?
No. JUL actually acts exactly like UST since it uses it thus a Java application connect to the session daemon that it can talk to.
Quoted 2 lines
2) I suppose the various commands have --kernel pre-empting --userspace pre-empting --ul?
Yup. This is actually not mention anywhere but looking at "lttng" command line code, the domain's order is: kernel, ust, jul. Probably we should actually output an error if the user uses multiple domain...
Quoted 2 lines
3) add-context: does --jul have the same possible context types as --userspace (i.e. ip,
pthread_id, procname, vpid, vtid)?Nope.
Quoted 3 lines
4) enable-channel:
4.1) Are the --jul --subbuf-size, --num-subbuf and --read-timer defaults the same as with --userspace?Nope. JUL uses it's internal channel so basically enable channel does NOT support the jul domain thus not having -j in the help/man.
Quoted 1 line
4.2) Presumably --output can only be mmap?
Yes. Same as UST but again you can't use enable-channel with JUl domain.
Quoted 2 lines
4.3) Are the --jul buffering schemes the same as with --userspace (i.e. --buffers-pid and --buffers-uid)?
Always per UID. You can't change it.
Quoted 2 lines
4.4) If yes, won't they all degenerate to the virtual machine's user and process IDs?
Not sure I understand this one?
Quoted 3 lines
5) enable-event:
5.1) Can you assign --jul events to multiple channels like you can in --userspace?No.
Quoted 1 line
5.2) Is the --jul event type --tracepoint or something else entirely?
It is tracepoint yes. For the JUL domain, ALL UST tracepoints are enabled (there is only one for now with the lttng-ust library we use (liblttng-ust-jul)).
Quoted 2 lines
5.3) Can the trailing wild card (and exclusion option) be used in the event name when enabling/disabling --jul events?
Wild card are NOT supported for the JUL domain. Thus for instance "lttng enable-event -j my_event_subsystem42_*" will not work. Only the "*" will work enabling every Loggers.
Quoted 8 lines
Quoted 1 line
6) list: Does bug #654 also apply to --jul?
Yes most probably. The session name is ignored.
Now after answering all this, I feel like either creating a lttng-jul man page or adding a special section in "lttng.1" for the JUL domain explaining all this. Thoughts?
I guess adding a JUL domain section to lttng.1 might be the way to go. Otherwise, it's unclear that people will find the lttng-jul man page, given it is related to the "lttng" command.
Thanks,
Mathieu
Quoted 4 lines
Cheers!
David
Signature · 3 lines
Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com