# HG changeset patch # User sla # Date 1398778905 -7200 # Tue Apr 29 15:41:45 2014 +0200 # Node ID c343d0db36707fd0d39e71474d5f6681ba5b093b # Parent 292091fae50a9ac89a6a38cc20c6883e91aba3fe imported patch 8031126-threadusertime diff --git a/src/os/linux/vm/os_linux.cpp b/src/os/linux/vm/os_linux.cpp --- a/src/os/linux/vm/os_linux.cpp +++ b/src/os/linux/vm/os_linux.cpp @@ -5271,7 +5271,6 @@ // static jlong slow_thread_cpu_time(Thread *thread, bool user_sys_cpu_time) { - static bool proc_task_unchecked = true; pid_t tid = thread->osthread()->thread_id(); char *s; char stat[2048]; @@ -5284,24 +5283,7 @@ long ldummy; FILE *fp; - snprintf(proc_name, 64, "/proc/%d/stat", tid); - - // The /proc//stat aggregates per-process usage on - // new Linux kernels 2.6+ where NPTL is supported. - // The /proc/self/task//stat still has the per-thread usage. - // See bug 6328462. - // There possibly can be cases where there is no directory - // /proc/self/task, so we check its availability. - if (proc_task_unchecked && os::Linux::is_NPTL()) { - // This is executed only once - proc_task_unchecked = false; - fp = fopen("/proc/self/task", "r"); - if (fp != NULL) { - snprintf(proc_name, 64, "/proc/self/task/%d/stat", tid); - fclose(fp); - } - } - + snprintf(proc_name, 64, "/proc/self/task/%d/stat", tid); fp = fopen(proc_name, "r"); if ( fp == NULL ) return -1; statlen = fread(stat, 1, 2047, fp);