jdk/src/solaris/sample/dtrace/hotspot/method_compile_stat.d
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 2 90ce3da70b43
child 5506 202f599c92aa
permissions -rw-r--r--
Initial load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#!/usr/sbin/dtrace -Zs
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * Redistribution and use in source and binary forms, with or without
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * modification, are permitted provided that the following conditions
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * are met:
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 *   - Redistributions of source code must retain the above copyright
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *     notice, this list of conditions and the following disclaimer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 *   - Redistributions in binary form must reproduce the above copyright
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 *     notice, this list of conditions and the following disclaimer in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 *     documentation and/or other materials provided with the distribution.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *   - Neither the name of Sun Microsystems nor the names of its
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 *     contributors may be used to endorse or promote products derived
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 *     from this software without specific prior written permission.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
*/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * Usage:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 *   1. method_compile_stat.d -c "java ..." TOP_RESULTS_COUNT INTERVAL_SECS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 *   2. method_compile_stat.d -p JAVA_PID TOP_RESULTS_COUNT INTERVAL_SECS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * This script prints statistics about TOP_RESULTS_COUNT (default is 25)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * methods with largest/smallest compilation time every INTERVAL_SECS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * (default is 60) seconds.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
#pragma D option quiet
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
#pragma D option destructive
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
#pragma D option defaultargs
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
#pragma D option aggrate=100ms
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
self char *str_ptr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
self string class_name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
self string method_name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
self string signature;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
int INTERVAL_SECS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
:::BEGIN
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    SAMPLE_NAME = "hotspot methods compilation tracing";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    TOP_RESULTS_COUNT = $1 ? $1 : 25;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    INTERVAL_SECS = $2 ? $2 : 60;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    COMPILED_METHODS_COUNT = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    LOADED_METHODS_CNT = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    UNLOADED_METHODS_CNT = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    SAMPLING_TIME = timestamp + INTERVAL_SECS * 1000000000ull;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    LINE_SEP =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    "------------------------------------------------------------------------";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    printf("BEGIN %s\n\n", SAMPLE_NAME);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
 * hotspot:::method-compile-begin
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
 *  arg0: char*,        a pointer to mUTF-8 string containing the name of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
 *                          the compiler
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
 *  arg1: uintptr_t,    the length of the compiler name (in bytes)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
 *  arg2: char*,        a pointer to mUTF-8 string containing the class name of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
 *                          the method being compiled
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
 *  arg3: uintptr_t,    the length of the class name (in bytes)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
 *  arg4: char*,        a pointer to mUTF-8 string containing the method name of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
 *                          the method being compiled
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
 *  arg5: uintptr_t,    the length of the method name (in bytes)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
 *  arg6: char*,        a pointer to mUTF-8 string containing the signature of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
 *                          the method being compiled
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
 *  arg7: uintptr_t,    the length of the signature(in bytes)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
hotspot$target:::method-compile-begin
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    /*compiler_name, len, class_name, len, method_name, len, signature, len*/
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    self->str_ptr = (char*) copyin(arg0, arg1+1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
    self->str_ptr[arg1] = '\0';
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    compiler_name = (string) self->str_ptr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
    self->str_ptr = (char*) copyin(arg2, arg3+1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
    self->str_ptr[arg3] = '\0';
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
    self->class_name = (string) self->str_ptr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    self->str_ptr = (char*) copyin(arg4, arg5+1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
    self->str_ptr[arg5] = '\0';
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    self->method_name = (string) self->str_ptr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    self->str_ptr = (char*) copyin(arg6, arg7+1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    self->str_ptr[arg7] = '\0';
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
    self->signature = (string) self->str_ptr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    self->ts[self->class_name, self->method_name, self->signature] = timestamp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
 * hotspot:::method-compile-end
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
 *  arg0: char*,        a pointer to mUTF-8 string containing the name of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
 *                          the compiler
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
 *  arg1: uintptr_t,    the length of the compiler name (in bytes)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
 *  arg2: char*,        a pointer to mUTF-8 string containing the class name of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
 *                          the method being compiled
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
 *  arg3: uintptr_t,    the length of the class name (in bytes)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
 *  arg4: char*,        a pointer to mUTF-8 string containing the method name of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
 *                          the method being compiled
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
 *  arg5: uintptr_t,    the length of the method name (in bytes)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
 *  arg6: char*,        a pointer to mUTF-8 string containing the signature of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
 *                          the method being compiled
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
 *  arg7: uintptr_t,    the length of the signature(in bytes)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
 *  arg8: uintptr_t,    boolean value which indicates if method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
 *                          has been compiled successfuly
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
hotspot$target:::method-compile-end
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
    /* compiler_name, len, class_name, len, method_name, len,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
       signature, len, isSuccess */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
    self->str_ptr = (char*) copyin(arg0, arg1+1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
    self->str_ptr[arg1] = '\0';
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
    compiler_name = (string) self->str_ptr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    self->str_ptr = (char*) copyin(arg2, arg3+1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    self->str_ptr[arg3] = '\0';
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
    self->class_name = (string) self->str_ptr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
    self->str_ptr = (char*) copyin(arg4, arg5+1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
    self->str_ptr[arg5] = '\0';
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
    self->method_name = (string) self->str_ptr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
    self->str_ptr = (char*) copyin(arg6, arg7+1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    self->str_ptr[arg7] = '\0';
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    self->signature = (string) self->str_ptr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
 * Method was successfuly compiled
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
hotspot$target:::method-compile-end
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
/arg8 && self->ts[self->class_name, self->method_name, self->signature]/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
    /* compiler_name, len, class_name, len, method_name, len,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
       signature, len, isSuccess */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
    COMPILED_METHODS_COUNT++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
    @compile_time_top[self->class_name, self->method_name, self->signature] =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     avg((timestamp -
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
      self->ts[self->class_name, self->method_name, self->signature]) / 1000);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
    @compile_time_last[self->class_name, self->method_name, self->signature] =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     avg((timestamp -
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
      self->ts[self->class_name, self->method_name, self->signature]) / 1000);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
    self->ts[self->class_name, self->method_name, self->signature] = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
 * Method compilation was failed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
hotspot$target:::method-compile-end
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
/arg8 != 1 && self->ts[self->class_name, self->method_name, self->signature]/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
    /* compiler_name, len, class_name, len, method_name, len,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
       signature, len, isSuccess */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    @fail_compile_count[self->class_name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
                        self->method_name, self->signature] = count();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
hotspot$target:::compiled-method-load
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    /* class_name, len, method_name, len, signature, len, code_address, size */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
    LOADED_METHODS_CNT ++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
hotspot$target:::compiled-method-unload
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
    /* class_name, len, method_name, len, signature, len, code_address, size */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
    UNLOADED_METHODS_CNT ++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
tick-1sec
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
/timestamp > SAMPLING_TIME/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
    trunc(@compile_time_top, TOP_RESULTS_COUNT);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
    trunc(@compile_time_last, -TOP_RESULTS_COUNT);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    printf("\n");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
    printf("%s\n", LINE_SEP);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    printf("%Y\n", walltimestamp);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
    printf("%s\n", LINE_SEP);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
    printf(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
        "\nTop %d methods with largest compilation time (in milleseconds):\n",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
        TOP_RESULTS_COUNT);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
    printa("%10@d %s::%s%s\n", @compile_time_top);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
    printf(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
        "\nTop %d methods with smallest compilation time (in milleseconds):\n",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
        TOP_RESULTS_COUNT);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
    printa("%10@d %s::%s%s\n", @compile_time_last);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
    printf("\n");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    printf("Compiled methods:         %10d\n", COMPILED_METHODS_COUNT);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    printf("Loaded compiled methods:  %10d\n", LOADED_METHODS_CNT);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
    printf("Unoaded compiled methods: %10d\n", UNLOADED_METHODS_CNT);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
    printf("\nFailed compilation:\n");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    printa("%10@d %s::%s%s\n", @fail_compile_count);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
    SAMPLING_TIME = timestamp + INTERVAL_SECS * 1000000000ull;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
:::END
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
    trunc(@compile_time_top, TOP_RESULTS_COUNT);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
    trunc(@compile_time_last, -TOP_RESULTS_COUNT);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
    printf("\n");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
    printf("%s\n", LINE_SEP);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
    printf("%Y\n", walltimestamp);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
    printf("%s\n", LINE_SEP);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
    printf(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
        "\nTop %d methods with largest compilation time (in milleseconds):\n",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
        TOP_RESULTS_COUNT);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
    printa("%10@d %s::%s%s\n", @compile_time_top);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
    printf(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
        "\nTop %d methods with smallest compilation time (in milleseconds):\n",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
        TOP_RESULTS_COUNT);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
    printa("%10@d %s::%s%s\n", @compile_time_last);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
    printf("\n");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
    printf("Compiled methods:         %10d\n", COMPILED_METHODS_COUNT);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
    printf("Loaded compiled methods:  %10d\n", LOADED_METHODS_CNT);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
    printf("Unoaded compiled methods: %10d\n", UNLOADED_METHODS_CNT);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
    printf("\nFailed compilations:\n");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
    printa("%10@d %s::%s%s\n", @fail_compile_count);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
    printf("\nEND of %s\n", SAMPLE_NAME);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
syscall::rexit:entry,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
syscall::exit:entry
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
/pid == $target/
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
   exit(0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
}