90700c69faff5a302218048b36d0616e91162133
1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <tmfxml xmlns:
xsi=
"http://www.w3.org/2001/XMLSchema-instance"
3 xsi:
noNamespaceSchemaLocation=
"xmlDefinition.xsd">
4 <!-- ***************************************************************************
5 * Copyright (c) 2016 Ericsson
7 * All rights reserved. This program and the accompanying materials are
8 * made available under the terms of the Eclipse Public License v1.0 which
9 * accompanies this distribution, and is available at
10 * http://www.eclipse.org/legal/epl-v10.html
11 *************************************************************************** -->
12 <pattern version=
"0" id=
"xml syscall abstraction provider">
14 <traceType id=
"org.eclipse.linuxtools.lttng2.kernel.tracetype" />
15 <label value=
"xml syscall abstraction provider" />
18 <!-- STORED FIELDS -->
20 <storedField id=
"filename"/>
21 <storedField id=
"fd"/>
22 <storedField id=
"ret" alias=
"ret"/>
23 <storedField id=
"flags" alias=
"flags"/>
24 <storedField id=
"offset" alias=
"offset"/>
25 <storedField id=
"fd_in" alias=
"fd_in"/>
26 <storedField id=
"fd_out" alias=
"fd_out"/>
27 <storedField id=
"uservaddr" alias=
"uservaddr"/>
28 <storedField id=
"upeer_sockaddr" alias=
"upeer_sockaddr"/>
32 <!-- Shorcut for the current running thread attribute -->
33 <location id=
"CurrentThread">
34 <stateAttribute type=
"constant" value=
"Threads" />
35 <stateAttribute type=
"query">
36 <stateAttribute type=
"constant" value=
"CPUs" />
37 <stateAttribute type=
"eventField" value=
"cpu" />
38 <stateAttribute type=
"constant" value=
"Current_thread" />
41 <!-- Shorcut for the current CPU attribute -->
42 <location id=
"CurrentCPU">
43 <stateAttribute type=
"constant" value=
"CPUs" />
44 <stateAttribute type=
"eventField" value=
"cpu" />
47 <!-- The attribute initial specifies the FSMs that will be instanciated at the beginning of the analysis -->
48 <patternHandler initial=
"sched_switch:syscall">
52 <!-- This condition check if the current running thread PID is 1311 -->
56 <stateValue type=
"query">
57 <stateAttribute type=
"location" value=
"CurrentCPU" />
58 <stateAttribute type=
"constant" value=
"Current_thread" />
60 <stateValue type=
"long" value=
"8998" />
64 <!-- Test this : if ( !(1 ns < ts < 3 ns) || ((ts -state.syscall_entry_x.ts) < 3 ns) ) -->
65 <test id=
"time_condition">
71 <in begin=
"1" end=
"3" />
76 <elapsedTime unit=
"ns">
77 <less since=
"syscall_entry_x" value=
"3" />
83 <!-- Test if the current running thread PID is equal to the current scenario thread -->
84 <test id=
"thread_thread">
87 <stateValue type=
"query" >
88 <stateAttribute type=
"location" value=
"CurrentCPU" />
89 <stateAttribute type=
"constant" value=
"Current_thread" />
91 <stateValue type=
"query">
92 <stateAttribute type=
"constant" value=
"#CurrentScenario" />
93 <stateAttribute type=
"constant" value=
"thread" />
101 <!-- Generates three state changes in the state system -->
102 <action id=
"sys_x_founded">
103 <!-- Save the name of the system call executed under the current scenario path-->
105 <stateAttribute type=
"constant" value=
"#CurrentScenario" />
106 <stateAttribute type=
"constant" value=
"syscall" />
107 <stateAttribute type=
"constant" value=
"name" />
108 <stateValue type=
"eventName"/>
110 <!-- Save the value of the CPU under the current scenario path -->
112 <stateAttribute type=
"constant" value=
"#CurrentScenario" />
113 <stateAttribute type=
"constant" value=
"cpu" />
114 <stateValue type=
"eventField" value=
"cpu"/>
116 <!-- Save the value of the current thread PID under the current scenario path -->
118 <stateAttribute type=
"constant" value=
"#CurrentScenario" />
119 <stateAttribute type=
"constant" value=
"thread" />
120 <stateValue type=
"query">
121 <stateAttribute type=
"location" value=
"CurrentCPU" />
122 <stateAttribute type=
"constant" value=
"Current_thread" />
127 <!-- Generate a pattern segment -->
128 <action id=
"exit_syscall_founded">
129 <!-- Generate a pattern segment with the name of the system call of the current scenario-->
133 <stateValue type=
"query">
134 <stateAttribute type=
"constant" value=
"#CurrentScenario" />
135 <stateAttribute type=
"constant" value=
"syscall" />
136 <stateAttribute type=
"constant" value=
"name" />
146 Declare an FSM to match all the system calls on thread 1311.
147 The FSM will generate pattern segments that will represent the system calls found
149 <fsm id=
"syscall" initial=
"wait_syscall_entry_x">
150 <!-- Validate that PID == 1311 before going to the initial state -->
152 <transition cond=
"tid_8998" target=
"wait_syscall_entry_x" />
154 <state id=
"wait_syscall_entry_x">
155 <!-- The state will stay here until we have a "syscall_entry_*" event -->
156 <transition event=
"syscall_entry_*" target=
"syscall_entry_x" action=
"sys_x_founded" saveStoredFields=
"true"/>
158 <state id=
"syscall_entry_x" >
159 <!-- The state will stay here until we have a "syscall_exit_*" event -->
160 <transition event=
"syscall_exit_*" cond=
"thread_thread" target=
"syscall_exit_x" action=
"exit_syscall_founded" saveStoredFields=
"true" clearStoredFields=
"true"/>
162 <!-- The state will stay here forever -->
163 <final id=
"syscall_exit_x"/>
166 <!-- SCHED_SWITCH FSM ACTIONS -->
167 <!-- Update the value of the current running thread -->
168 <action id=
"update Current_thread">
170 <stateAttribute type=
"location" value=
"CurrentCPU" />
171 <stateAttribute type=
"constant" value=
"Current_thread" />
172 <stateValue type=
"eventField" value=
"next_tid" />
175 <!-- sched_switch fsm
176 Declare an FSM to update the value of the current thread running.
177 The FSM will generate a state change to update the current thread, each time that it will meet a sched_switch event.
179 <fsm id=
"sched_switch" multiple=
"false">
180 <!-- if event.name != sched_switch, no processing will be done -->
181 <precondition event=
"sched_switch"/>
183 <transition target=
"sched_switch"/>
185 <state id=
"sched_switch">
186 <!-- The state will stay here forever and execute the action "update current thread" each time a sched_switch event will be meet-->
187 <transition target=
"sched_switch" action=
"update Current_thread" />
This page took 0.036664 seconds and 4 git commands to generate.