<?xml version="1.0" encoding="UTF-8"?>
<tmfxml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:noNamespaceSchemaLocation="xmlDefinition.xsd">
<!-- ***************************************************************************
* Copyright (c) 2016 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License 2.0 which
* accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*************************************************************************** -->
<pattern version="0" id="syscall.analysis">
	<mappingGroup id="group">
		<entry>
			<stateValue type="int" value="1" />
			<stateValue type="string" value="open" />
		</entry>
	</mappingGroup>
	<patternHandler>
		<action id="increment_counter_consuming">
			<stateChange>
				<stateAttribute type="constant" value="consuming" />
				<stateValue increment="true" type="long" value="1"/>
			</stateChange>
		</action>

		<fsm id="consuming">
			<state id="start">
				<transition event="entry" target="exit_state"/>
			</state>
			<state id="exit_state" >
				<transition event="exit" target="end" action="increment_counter_consuming"/>
			</state>
			<final id="end"/>
		</fsm>

		<action id="increment_counter_non_consuming">
			<stateChange>
				<stateAttribute type="constant" value="non_consuming" />
				<stateValue increment="true" type="long" value="1"/>
			</stateChange>
		</action>

		<fsm id="non_consuming" consuming="false">
			<state id="start">
				<transition event="entry" target="exit_state"/>
			</state>
			<state id="exit_state" >
				<transition event="exit" target="end" action="increment_counter_non_consuming"/>
			</state>
			<final id="end"/>
		</fsm>

		<action id="segment_create">
			<segment>
				<segType>
					<segName>
						<stateValue mappingGroup="group" type="int" value="1"/>
					</segName>
				</segType>
			</segment>
		</action>

		<fsm id="mapping" multiple="false">
			<state id="start">
				<transition event="entry" target="end" action="segment_create" />
			</state>
			<final id="end"/>
		</fsm>
	</patternHandler>
</pattern>
</tmfxml>