1 /*******************************************************************************
2 * Copyright (c) 2013, 2014 Ericsson
4 * All rights reserved. This program and the accompanying materials are made
5 * 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 * Patrick Tasse - Initial API and implementation
11 * Bernd Hufmann - Updated for new parent class
12 *******************************************************************************/
14 package org
.eclipse
.tracecompass
.tmf
.ctf
.core
.event
.lookup
;
16 import java
.util
.Objects
;
18 import org
.eclipse
.tracecompass
.ctf
.core
.event
.CTFCallsite
;
19 import org
.eclipse
.tracecompass
.tmf
.core
.event
.lookup
.TmfCallsite
;
22 * CTF TMF call site information for source code lookup.
24 * @author Patrick Tasse
27 public class CtfTmfCallsite
extends TmfCallsite
{
29 // ------------------------------------------------------------------------
31 // ------------------------------------------------------------------------
33 /** The event name. */
34 private final String fEventName
;
36 /** The instruction pointer. */
37 private final long fInstructionPointer
;
39 // ------------------------------------------------------------------------
41 // ------------------------------------------------------------------------
44 * Standard Constructor.
49 public CtfTmfCallsite(CTFCallsite callsite
) {
50 super(callsite
.getFileName(), callsite
.getLineNumber());
51 fEventName
= callsite
.getEventName();
52 fInstructionPointer
= callsite
.getIp();
55 // ------------------------------------------------------------------------
57 // ------------------------------------------------------------------------
60 * Returns the event name of the call site.
62 * @return the event name
64 public String
getEventName() {
69 * Returns the instruction pointer of the call site.
71 * @return the instruction pointer
73 public long getIntructionPointer() {
74 return fInstructionPointer
;
77 // ------------------------------------------------------------------------
79 // ------------------------------------------------------------------------
82 public int hashCode() {
84 int result
= super.hashCode();
85 result
= prime
* result
+ ((fEventName
== null) ?
0 : fEventName
.hashCode());
86 result
= prime
* result
+ (int) (fInstructionPointer ^
(fInstructionPointer
>>> 32));
91 public boolean equals(Object obj
) {
95 if (!super.equals(obj
)) {
98 if (getClass() != obj
.getClass()) {
101 CtfTmfCallsite other
= (CtfTmfCallsite
) obj
;
102 if (!Objects
.equals(fEventName
, other
.fEventName
)) {
105 if (fInstructionPointer
!= other
.fInstructionPointer
) {
112 public String
toString() {
113 return getEventName() + "@0x" + Long
.toHexString(fInstructionPointer
) + ": " + //$NON-NLS-1$ //$NON-NLS-2$
114 getFileName() + ':' + String
.valueOf(getLineNo()) + ' ' + getFileName() + "()"; //$NON-NLS-1$
This page took 0.041873 seconds and 5 git commands to generate.