You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[reporter="duanetiemann", created="Tue, 25 Mar 2014 14:22:59 +0100"]
The following program fails to record the call to LinkedList.offer from readDataFromOpenFile. The output shows that readDataFromOpenFile is called and the probe that directly monitors LinkedList.offer when called from readDataFromOpenFile does fire and the jstackStr shows that it is called directly from readDataFromOpenFile. The probe with Kind.CALL is missed. Hopefully this is a horrible error on my part, but I don't see it.
My take on this would be that you are calling the offer method on java.util.Deque interface as opposed to calling it directly on java.util.LinkedList implementation class. And therefore it is not matched as the handler expects java.util.LinkedList.
You would have to provide an exact type the method is called on. The @Location.clazz might be extended to understand the +" notation and match all subclasses and implementations but it would increase the time needed for processing the classes because a lot of classes would have to be retransformed right after they were initialized to make sure the supertypes/interfaces were loaded and initialized. I am not sure whether it is worth it.
[reporter="duanetiemann", created="Tue, 25 Mar 2014 14:22:59 +0100"]
The following program fails to record the call to LinkedList.offer from readDataFromOpenFile. The output shows that readDataFromOpenFile is called and the probe that directly monitors LinkedList.offer when called from readDataFromOpenFile does fire and the jstackStr shows that it is called directly from readDataFromOpenFile. The probe with Kind.CALL is missed. Hopefully this is a horrible error on my part, but I don't see it.
importcom.sun.btrace.annotations.*;
importcom.sun.btrace.AnyType;
import static com.sun.btrace.BTraceUtils.*;
@btrace
public class ProblemDemo
{
static int Count=0;
static int MaxCount=500;
@tls static boolean InreadDataFromOpenFile = false;
@OnMethod(clazz="com.emc.storageos.data.object.controller.impl.FileSystemDeviceController", method="readDataFromOpenFile",location=@location(Kind.ENTRY))
public static void readDataFromOpenFileEntry(AnyType[] args)
{
InreadDataFromOpenFile = true;
println(strcat(str(threadId(currentThread())) ,
strcat(timestamp(" yyyy/MM/dd HH:mm:ss.SSS ") ,
strcat(str(timeNanos()) ,
" readDataFromOpenFile Entry"))));
if (Count++ > MaxCount)exit();
}
@OnMethod(clazz="com.emc.storageos.data.object.controller.impl.FileSystemDeviceController", method="readDataFromOpenFile",location=@location(Kind.RETURN))
public static void readDataFromOpenFileReturn()
{
InreadDataFromOpenFile = false;
println(strcat(str(threadId(currentThread())) ,
strcat(timestamp(" yyyy/MM/dd HH:mm:ss.SSS ") ,
strcat(str(timeNanos()) ,
" readDataFromOpenFile Return"))));
if (Count++ > MaxCount)exit();
}
@OnMethod(clazz="java.util.LinkedList", method="offer", location=@location(Kind.ENTRY))
public static void LinkedListofferEntry()
{
if (!InreadDataFromOpenFile)return;
println(strcat(str(threadId(currentThread())) ,
strcat(timestamp(" yyyy/MM/dd HH:mm:ss.SSS ") ,
strcat(str(timeNanos()) ,
strcat(" LinkedList.offer Entry" ,
strcat(" stack=" ,
jstackStr()))))));
if (Count++ > MaxCount)exit();
}
@OnMethod(clazz="com.emc.storageos.data.object.controller.impl.FileSystemDeviceController", method="readDataFromOpenFile",
location=@location(value=Kind.CALL,clazz="java.util.LinkedList",method="offer"))
public static void readDataFromOpenFilecallsLinkedListofferEntry()
{
println(strcat(str(threadId(currentThread())) ,
strcat(timestamp(" yyyy/MM/dd HH:mm:ss.SSS ") ,
strcat(str(timeNanos()) ,
" readDataFromOpenFile_calls_LinkedList.offer Entry"))));
if (Count++ > MaxCount)exit();
}
}
The text was updated successfully, but these errors were encountered: