| 1 |
/* Copyright (C) 2022-2025 Free Software Foundation |
| 2 |
|
| 3 |
This program is free software; you can redistribute it and/or modify |
| 4 |
it under the terms of the GNU General Public License as published by |
| 5 |
the Free Software Foundation, either version 3 of the License, or |
| 6 |
(at your option) any later version. |
| 7 |
|
| 8 |
This program is distributed in the hope that it will be useful, |
| 9 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 |
GNU General Public License for more details. |
| 12 |
|
| 13 |
You should have received a copy of the GNU General Public License |
| 14 |
along with this program. If not, see <http://www.gnu.org/licenses>. */ |
| 15 |
|
| 16 |
package org.gprofng.mpmt.timeline.events; |
| 17 |
|
| 18 |
import org.gprofng.mpmt.statecolors.StackState; |
| 19 |
import java.util.Collections; |
| 20 |
import java.util.List; |
| 21 |
|
| 22 |
public abstract class ExtendedEvent extends EventDetail { |
| 23 |
private final int lwpid; |
| 24 |
private final int thrid; |
| 25 |
private final int cpuid; |
| 26 |
|
| 27 |
private final Long stack; |
| 28 |
private final List<StackState> stackStates; |
| 29 |
private final long func; // leaf function |
| 30 |
|
| 31 |
public ExtendedEvent( |
| 32 |
final int lwpid, |
| 33 |
final int thrid, |
| 34 |
final int cpuid, |
| 35 |
final long ts, |
| 36 |
final long stack, |
| 37 |
final long func, |
| 38 |
long time_adjust, |
| 39 |
final List<StackState> stackStates) { |
| 40 |
super(ts, time_adjust); |
| 41 |
|
| 42 |
this.lwpid = lwpid; |
| 43 |
this.thrid = thrid; |
| 44 |
this.cpuid = cpuid; |
| 45 |
|
| 46 |
if (stack != 0) |
| 47 |
this.stack = stack; |
| 48 |
else this.stack = null; |
| 49 |
this.stackStates = Collections.unmodifiableList(stackStates); |
| 50 |
this.func = func; |
| 51 |
} |
| 52 |
|
| 53 |
public final int getLWP() { |
| 54 |
return lwpid; |
| 55 |
} |
| 56 |
|
| 57 |
public final int getThread() { |
| 58 |
return thrid; |
| 59 |
} |
| 60 |
|
| 61 |
public final int getCPU() { |
| 62 |
return cpuid; |
| 63 |
} |
| 64 |
|
| 65 |
@Override |
| 66 |
public final long getStack() { |
| 67 |
return stack.longValue(); |
| 68 |
} |
| 69 |
|
| 70 |
@Override |
| 71 |
public final List<StackState> getStackStates() { |
| 72 |
return stackStates; |
| 73 |
} |
| 74 |
} |