1 /*******************************************************************************
2 * Copyright (c) 2013 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
.linuxtools
.tmf
.ctf
.core
;
16 import org
.eclipse
.linuxtools
.ctf
.core
.event
.CTFCallsite
;
17 import org
.eclipse
.linuxtools
.tmf
.core
.event
.lookup
.TmfCallsite
;
20 * CTF TMF call site information for source code lookup.
22 * @author Patrick Tasse
25 public class CtfTmfCallsite
extends TmfCallsite
{
27 // ------------------------------------------------------------------------
29 // ------------------------------------------------------------------------
31 /** The event name. */
32 final private String fEventName
;
34 /** The instruction pointer. */
35 final private long fInstructionPointer
;
37 // ------------------------------------------------------------------------
39 // ------------------------------------------------------------------------
42 * Standard Constructor.
47 CtfTmfCallsite(CTFCallsite callsite
) {
48 super(callsite
.getFileName(), callsite
.getFunctionName(), callsite
.getLineNumber());
49 fEventName
= callsite
.getEventName();
50 fInstructionPointer
= callsite
.getIp();
53 // ------------------------------------------------------------------------
55 // ------------------------------------------------------------------------
58 * Returns the event name of the call site.
59 * @return the event name
61 public String
getEventName() {
66 * Returns the instruction pointer of the call site.
67 * @return the instruction pointer
69 public long getIntructionPointer() {
70 return fInstructionPointer
;
73 // ------------------------------------------------------------------------
75 // ------------------------------------------------------------------------
78 public int hashCode() {
80 int result
= super.hashCode();
81 result
= prime
* result
+ ((fEventName
== null) ?
0 : fEventName
.hashCode());
82 result
= prime
* result
+ (int) (fInstructionPointer ^
(fInstructionPointer
>>> 32));
87 public boolean equals(Object obj
) {
91 if (!super.equals(obj
)) {
94 if (getClass() != obj
.getClass()) {
97 CtfTmfCallsite other
= (CtfTmfCallsite
) obj
;
98 if (fEventName
== null) {
99 if (other
.fEventName
!= null) {
102 } else if (!fEventName
.equals(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() + ':' + Long
.toString(getLineNumber()) + ' ' + getFileName() + "()"; //$NON-NLS-1$
This page took 0.033832 seconds and 5 git commands to generate.