Convert char [] to string in BTrace

I profile the application with btrace and ran into a limitation. I am trying to get the name of the current one java.lang.Thread. Normally you can call getName(), but this is forbidden in btrace scripts (any exception calls BTraceUtils).
Is there any idea how to get String from char[]?

The initial task is to check if the stream name contains a substring and only then displays trace information (decreasing the output).

+3
source share
2 answers

"" () BTraceUtils. , , Thread . , threadId (thread), .

BTraceUtils - javadoc.

,

JB

+1

, :

https://btrace.dev.java.net/source/browse/btrace/docs/usersguide.html?rev=1.7

, BTrace

  • .
  • .
  • .
  • .
  • - com.sun.btrace.BTraceUtils BTrace.
  • . BTrace ( "trace " ).
  • . BTrace. .
  • , , .
  • .
  • (, while, do..while)
  • ( java.lang.Object)
  • .
  • assert.
  • .

http://btrace.kenai.com/javadoc/1.1/com/sun/btrace/BTraceUtils.html

+3

Source: https://habr.com/ru/post/1750330/


All Articles