2 Replies Latest reply: Sep 24, 2009 3:24 AM by 800341 RSS

    Dtrace special characters : [L , [Z , [I , [S , [B

    800341
      I am using the following script to generate statistics about the newly created objects. (using the probe object-alloc)

      In the output i can see some texts like

      [L , [Z , [I , [S , [B  and so on... please have a look at the following example. Alos [L always ends with  a ;


      Could any one you please let me what do those characters mean?

      thanks


      {code}
      [Ljava/lang/reflect/Constructor;   
      [Ljava/lang/ThreadLocal$ThreadLocalMap$Entry;
      [I  
      [Ljava/lang/Class;     
      [[I   
      [Labc/def/ghi/MyClass;
      [S   {code}
      dtrace:::BEGIN{
      total = 0;
      new =0;
      threadArray[0]="Zero";
      threadArray[1]="Main";
      }
      
      :::object-alloc {
          self->str_ptr = (char*) copyin(arg1, arg2+1);
          self->str_ptr[arg2] = '\0';
          self->classname = (string) self->str_ptr;
          /*@allocs_count[self->classname] = count();
          @allocs_size[self->classname] = sum(arg3);*/
      }
      
      :::object-alloc 
      / self->classname == "java/lang/String"/ {
           new++;
           @aggregate_thread_ids[arg0]=count();
           @aggregate_thread_names[threadArray[arg0]]=count();
      }
      
      :::thread-start
      {
         self->ptr = (char*) copyin(arg0, arg1+1);
         self->ptr[arg1] = '\0';
         self->threadname = (string) self->ptr;
         threadArray[arg2]=self->threadname;
         printf("Thread with name %s java_thread_id %d os_thread_id %d started\n", self->threadname, arg2, arg3);
      }
      
      profile:::tick-10s{
           printf("Newly created objects under test: %d", new);
           total=total+new;
           printf("    Total objects under test: %d", total);
           new=0;
      }
        • 1. Re: Dtrace special characters : [L , [Z , [I , [S , [B
          807559
          These symbols an array and its type:

          [L -> class array
          [Z -> boolean array
          [I -> integer array
          [S -> short array
          [B -> byte array                                                                                                                                                                                                                                                                   
          • 2. Re: Dtrace special characters : [L , [Z , [I , [S , [B
            800341
            Thanks Michael_Ernest

            could you please tell me where did u read this or any further references?

            thanks a lot