|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 package com.nokia.carbide.cpp.pi.priority2; |
|
19 |
|
20 import java.util.Hashtable; |
|
21 |
|
22 import com.nokia.carbide.cpp.internal.pi.model.GenericSampledTrace; |
|
23 import com.nokia.carbide.cpp.internal.pi.model.GenericThread; |
|
24 import com.nokia.carbide.cpp.internal.pi.model.TraceWithThreads; |
|
25 import com.nokia.carbide.cpp.internal.pi.visual.GenericTraceGraph; |
|
26 |
|
27 |
|
28 public class NewPriTrace extends GenericSampledTrace implements TraceWithThreads |
|
29 { |
|
30 private static final long serialVersionUID = 7929002387070527775L; |
|
31 |
|
32 private Hashtable firstSynchTimes; |
|
33 private Hashtable lastSynchTimes; |
|
34 private int samplingTime; |
|
35 private NewPriThread[] threads; |
|
36 |
|
37 public NewPriTrace() |
|
38 { |
|
39 firstSynchTimes = new Hashtable(); |
|
40 lastSynchTimes = new Hashtable(); |
|
41 } |
|
42 |
|
43 public void addSample(NewPriSample sample) |
|
44 { |
|
45 this.samples.add(sample); |
|
46 } |
|
47 |
|
48 public NewPriSample getPriSample(int number) |
|
49 { |
|
50 return (NewPriSample)this.samples.elementAt(number); |
|
51 } |
|
52 |
|
53 public GenericTraceGraph getTraceGraph() |
|
54 { |
|
55 return null; |
|
56 } |
|
57 |
|
58 public GenericThread[] getThreads() |
|
59 { |
|
60 return threads; |
|
61 } |
|
62 |
|
63 public void setThreads(NewPriThread[] threads) |
|
64 { |
|
65 this.threads = threads; |
|
66 } |
|
67 |
|
68 // public long getLastSynchTimeForThread(GenericThread t) |
|
69 // { |
|
70 // return ((Integer) lastSynchTimes.get(t.threadId)).intValue(); |
|
71 // } |
|
72 // |
|
73 // public long getFirstSynchTimeForThread(GenericThread t) |
|
74 // { |
|
75 // return ((Integer) firstSynchTimes.get(t.threadId)).intValue(); |
|
76 // } |
|
77 |
|
78 public void addFirstSynchTime(Integer id, Integer firstSynchTime) |
|
79 { |
|
80 firstSynchTimes.put(id, firstSynchTime); |
|
81 } |
|
82 |
|
83 public void addLastSynchTime(Integer id, Integer lastSynchTime) |
|
84 { |
|
85 lastSynchTimes.put(id, lastSynchTime); |
|
86 } |
|
87 |
|
88 public void setSamplingTime(int time) |
|
89 { |
|
90 this.samplingTime = time; |
|
91 } |
|
92 |
|
93 public int getSamplingTime() |
|
94 { |
|
95 return samplingTime; |
|
96 } |
|
97 } |