From owner-freebsd-stable@FreeBSD.ORG Sat Jan 7 22:37:18 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4E2D106566B for ; Sat, 7 Jan 2012 22:37:18 +0000 (UTC) (envelope-from schors@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 572598FC0A for ; Sat, 7 Jan 2012 22:37:17 +0000 (UTC) Received: by werb13 with SMTP id b13so2773619wer.13 for ; Sat, 07 Jan 2012 14:37:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=5bjDa5Jiwx4Fv5fjjFR0AnE+qPVXOe38JuRFLYO74b4=; b=uyo7PUCuX2znnrazyPyOdBLhzQGQziapRDtdjrnU44JxvGz0WvsTPhLf0pvwYhYjhw Gx1V4KZZHf1gNIYUvDygKjAn1Z/CsCwsor8c4CJHa8IKHpUbmbRcFF6zbpVwihkCkoad mTm0JOAGhL0pgh3A+nkVeDkdiZ2HBP+bHEk0M= MIME-Version: 1.0 Received: by 10.180.76.8 with SMTP id g8mr19006214wiw.3.1325974006555; Sat, 07 Jan 2012 14:06:46 -0800 (PST) Received: by 10.216.255.82 with HTTP; Sat, 7 Jan 2012 14:06:46 -0800 (PST) Date: Sun, 8 Jan 2012 01:06:46 +0300 Message-ID: From: Phil Kulin To: freebsd-stable@freebsd.org Content-Type: text/plain; charset=UTF-8 Subject: kproc_info system and user time is broken for processes with threads X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2012 22:37:18 -0000 kproc_info system and user time is broken for processes with threads, when fetch then by kvm_getprocs() function call. For example, modern 'ps' on server running mysqld (145 precached threads) # ps -ax -o comm,cputime,systime,usertime | grep mysqld mysqld 16872:35.39 5249:07.68 3353:36.79 # ps -ax -o comm,cputime,systime,usertime | grep httpd httpd 0:00.02 0:00.00 0:00.02 httpd 0:00.00 0:00.00 0:00.00 httpd 0:02.51 0:01.77 0:00.75 Sum systime+usertime=cputime for httpd, but different for mysqld. systime and usertime for mysqld not changed many times, but cputime increased. Modern ps uses ki_rusage.ru_stime and ki_rusage.ru_utime from kproc_info for systime and usertime statistic. What wrong? -- Non nobis Domine non nobis sed Nomini Tuo da gloriam Phil Kulin