9570cc17d741db9da7046985c2f67b7553346d3b
1 /*******************************************************************************
2 * Copyright (c) 2014 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Matthew Khouzam - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.tracecompass
.btf
.core
.trace
;
17 import org
.eclipse
.tracecompass
.btf
.core
.Messages
;
18 import org
.eclipse
.tracecompass
.btf
.core
.event
.BtfEventType
;
20 import com
.google
.common
.collect
.ImmutableMap
;
23 * Entity Types for BTF
25 * @author Matthew Khouzam
27 public final class BtfEventTypeFactory
{
29 private BtfEventTypeFactory() {}
31 private static final Map
<String
, BtfEventType
> TYPES
;
34 ImmutableMap
.Builder
<String
, BtfEventType
> builder
= new ImmutableMap
.Builder
<>();
36 builder
.put("STI", new BtfEventType(Messages
.BtfTypeId_STIName
, Messages
.BtfTypeId_STIDescr
)); //$NON-NLS-1$
38 builder
.put("T", new BtfEventType(Messages
.BtfTypeId_TName
, Messages
.BtfTypeId_TDescr
)); //$NON-NLS-1$
39 builder
.put("ISR", new BtfEventType(Messages
.BtfTypeId_ISRName
, Messages
.BtfTypeId_ISRDescr
)); //$NON-NLS-1$
40 builder
.put("R", new BtfEventType(Messages
.BtfTypeId_RName
, Messages
.BtfTypeId_RDescr
)); //$NON-NLS-1$
41 builder
.put("IB", new BtfEventType(Messages
.BtfTypeId_IBName
, Messages
.BtfTypeId_IBDescr
)); //$NON-NLS-1$
43 builder
.put("ECU", new BtfEventType(Messages
.BtfTypeId_ECUName
, Messages
.BtfTypeId_ECUDescr
)); //$NON-NLS-1$
44 builder
.put("P", new BtfEventType(Messages
.BtfTypeId_PName
, Messages
.BtfTypeId_PDescr
)); //$NON-NLS-1$
45 builder
.put("C", new BtfEventType(Messages
.BtfTypeId_CName
, Messages
.BtfTypeId_CDescr
)); //$NON-NLS-1$
47 builder
.put("SCHED", new BtfEventType(Messages
.BtfTypeId_SCHEDName
, Messages
.BtfTypeId_SCHEDDescr
)); //$NON-NLS-1$
48 builder
.put("SIG", new BtfEventType(Messages
.BtfTypeId_SIGName
, Messages
.BtfTypeId_SIGDescr
)); //$NON-NLS-1$
49 builder
.put("SEM", new BtfEventType(Messages
.BtfTypeId_SEMName
, Messages
.BtfTypeId_SEMDescr
)); //$NON-NLS-1$
51 builder
.put("SIM", new BtfEventType(Messages
.BtfTypeId_SIMName
, Messages
.BtfTypeId_SIMDescr
)); //$NON-NLS-1$
52 TYPES
= builder
.build();
56 * Parse the string and get a type id
60 * @return a BTF trace type, can be null if the string is invalid.
62 public static BtfEventType
parse(String typeName
) {
63 return TYPES
.get(typeName
);
This page took 0.032294 seconds and 4 git commands to generate.