Project

General

Profile

Bug #1135

Updated by Jonathan Rajotte Julien almost 6 years ago

lttng create saved_trace                     
 lttng enable-event --jul hello                          
 lttng enable-event --log4j hello                         
 lttng add-context --jul --type='$app.myRetriever:intCtx' 
 lttng save --output-path=/tmp 

 Will result in a saved session where both the JUL default channel and the LOG4J default channel have the context "$app.myRetriever:intCtx" 
 present. 

 This is also the case if a userspace channel is present and if a python channel is present. 

 Per the man page, I would expect that the context is added only to all channels under a specific domain. I might be misinterpreting the man page manage given that it also specify that if no channel name is given it will apply to all channels of the session. 

 <pre> 
    Domain 
        One of: 

        -j, --jul 
            Add context to channel in the java.util.logging (JUL) domain. 

        -k, --kernel 
            Add context to channel in the Linux kernel domain. 

        -l, --log4j 
            Add context to channel in the Apache log4j domain. 

        -u, --userspace 
            Add context to channel in the user space domain. 
 </pre> 

 <pre> 
 <?xml version="1.0" encoding="UTF-8"?> 
 <sessions> 
	 <session> 
		 <name>saved_trace</name> 
		 <domains> 
			 <domain> 
				 <type>UST</type> 
				 <buffer_type>PER_UID</buffer_type> 
				 <channels/> 
				 <trackers/> 
			 </domain> 
			 <domain> 
				 <type>JUL</type> 
				 <buffer_type>PER_UID</buffer_type> 
				 <channels> 
					 <channel> 
						 <name>lttng_jul_channel</name> 
						 <enabled>true</enabled> 
						 <overwrite_mode>DISCARD</overwrite_mode> 
						 <subbuffer_size>131072</subbuffer_size> 
						 <subbuffer_count>4</subbuffer_count> 
						 <switch_timer_interval>0</switch_timer_interval> 
						 <read_timer_interval>0</read_timer_interval> 
						 <output_type>MMAP</output_type> 
						 <tracefile_size>0</tracefile_size> 
						 <tracefile_count>0</tracefile_count> 
						 <live_timer_interval>0</live_timer_interval> 
						 <events> 
							 <event> 
								 <name>hello</name> 
								 <enabled>true</enabled> 
								 <type>TRACEPOINT</type> 
								 <loglevel_type>ALL</loglevel_type> 
								 <filter>logger_name == &quot;hello&quot;</filter> 
							 </event> 
						 </events> 
						 <contexts> 
							 <context> 
								 <app> 
									 <provider_name>myRetriever</provider_name> 
									 <ctx_name>intCtx</ctx_name> 
								 </app> 
							 </context> 
						 </contexts> 
					 </channel> 
				 </channels> 
			 </domain> 
			 <domain> 
				 <type>LOG4J</type> 
				 <buffer_type>PER_UID</buffer_type> 
				 <channels> 
					 <channel> 
						 <name>lttng_log4j_channel</name> 
						 <enabled>true</enabled> 
						 <overwrite_mode>DISCARD</overwrite_mode> 
						 <subbuffer_size>131072</subbuffer_size> 
						 <subbuffer_count>4</subbuffer_count> 
						 <switch_timer_interval>0</switch_timer_interval> 
						 <read_timer_interval>0</read_timer_interval> 
						 <output_type>MMAP</output_type> 
						 <tracefile_size>0</tracefile_size> 
						 <tracefile_count>0</tracefile_count> 
						 <live_timer_interval>0</live_timer_interval> 
						 <events> 
							 <event> 
								 <name>hello</name> 
								 <enabled>true</enabled> 
								 <type>TRACEPOINT</type> 
								 <loglevel_type>ALL</loglevel_type> 
								 <filter>logger_name == &quot;hello&quot;</filter> 
							 </event> 
						 </events> 
						 <contexts> 
							 <context> 
								 <app> 
									 <provider_name>myRetriever</provider_name> 
									 <ctx_name>intCtx</ctx_name> 
								 </app> 
							 </context> 
						 </contexts> 
					 </channel> 
				 </channels> 
			 </domain> 
			 <domain> 
				 <type>PYTHON</type> 
				 <buffer_type>PER_UID</buffer_type> 
				 <channels/> 
			 </domain> 
		 </domains> 
		 <started>false</started> 
		 <output> 
			 <consumer_output> 
				 <enabled>true</enabled> 
				 <destination> 
					 <path>/tmp/lttng-ivc-maxk78gt/lttng-traces/saved_trace-20171111-162822</path> 
				 </destination> 
			 </consumer_output> 
		 </output> 
	 </session> 
 </sessions> 
 </pre> 

Back