login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
openbsd-misc
»
2010
»
January
»
13
Re: OpenBSD CPU Load Calculation of a Process
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: patrick keshishian
Subject:
Re: OpenBSD CPU Load Calculation of a Process
Date: Wednesday, January 13, 2010 - 1:28 pm
On Wed, Jan 13, 2010 at 2:07 AM, Sebastian Spies <sebastian.spies@de-cix.net> wrote: [dd]
quoted text
> Could you > please comment on the following code? > > int main(int argc, char** argv) > { > kvm_t *kd; > struct kinfo_proc2 *info; > int cnt; > > if(argc != 2) > { > printf("Please provide pid\n"); > exit(1); > } > > > kd = kvm_open(NULL, NULL, NULL, KVM_NO_FILES, "error"); > if(!kd) > exit(1); > > if(cnt != 1)
Not related to what you are asking about, but, you are checking cnt before it is set.
quoted text
> { > printf("No process found\n"); > exit(1); > } > > info = kvm_getproc2(kd, KERN_PROC_PID, atoi(argv[1]), > sizeof(struct kinfo_proc2), &cnt); > > printf("%x\n",(double)info->p_cpticks); > > exit(0); > }
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
OpenBSD CPU Load Calculation of a Process
, Sebastian Spies
, (Wed Jan 13, 3:07 am)
Re: OpenBSD CPU Load Calculation of a Process
, patrick keshishian
, (Wed Jan 13, 1:28 pm)
Re: OpenBSD CPU Load Calculation of a Process
, Aaron Mason
, (Wed Jan 13, 4:19 pm)
Re: OpenBSD CPU Load Calculation of a Process
, Sebastian Spies
, (Thu Jan 14, 4:50 am)
Re: OpenBSD CPU Load Calculation of a Process
, Philip Guenther
, (Thu Jan 14, 11:20 am)
Re: OpenBSD CPU Load Calculation of a Process
, Bryan Irvine
, (Thu Jan 14, 1:10 pm)
Re: OpenBSD CPU Load Calculation of a Process
, Aaron Mason
, (Thu Jan 14, 4:48 pm)
Re: OpenBSD CPU Load Calculation of a Process
, Tomas Bodzar
, (Thu Jan 14, 11:51 pm)
Re: OpenBSD CPU Load Calculation of a Process
, Philip Guenther
, (Fri Jan 15, 12:56 am)
Re: OpenBSD CPU Load Calculation of a Process
, Tomas Bodzar
, (Fri Jan 15, 1:38 am)
Re: OpenBSD CPU Load Calculation of a Process
, Sebastian Spies
, (Mon Jan 18, 2:11 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Ingo Molnar
Re: [patch] e1000=y && e1000e=m regression fix
Greg Kroah-Hartman
[PATCH 20/36] Driver core: Call device_pm_add() after bus_add_device() in device_a...
Boaz Harrosh
how to use KBUILD_EXTRA_SYMBOLS
Pekka Enberg
Re: [PATCH] include/linux/slab.h: new KFREE() macro.
Brandeburg, Jesse
RE: [regression] e1000e broke e1000 (was: Re: [ANNOUNCE] e1000 toe1000e migration ...
git
:
Bill Lear
cpio command not found
Jing Xue
Re: git rm --cached
Fredrik Kuivinen
Re: fatal: unable to create '.git/index': File exists
Michael S. Tsirkin
git-kill: rewrite history removing a commit
Johannes Schindelin
Re: [PATCH 1/3 v2] Implement the patience diff algorithm
linux-netdev
:
Jamie Lokier
Re: POHMELFS high performance network filesystem. Transactions, failover, performa...
Johann Baudy
Packet mmap: TX RING and zero copy
Stephen Hemminger
Re: NAPI, rx_no_buffer_count, e1000, r8169 and other actors
Oliver Neukum
Re: [RFC] Patch to option HSO driver to the kernel
Paulius Zaleckas
Re: [RFC] Patch to option HSO driver to the kernel
openbsd-misc
:
Netmaffia.hu
Tini Lányok AKCIÓBAN OTTHON
Bryan Irvine
Re: DVD burn error: No space left on device
Tomas Bodzar
Re: OpenSMTPd actual development and integration
Siju George
This is what Linus Torvalds calls openBSD crowd
elitdostlar
Seks partneri arayan bayanlar bu adreste - 8878xs706x6438
git-commits-head
:
Linux Kernel Mailing List
powerpc/fsl_msi: enable msi allocation in all banks
Linux Kernel Mailing List
via82cxxx: add support for VT6415 PCIE PATA IDE Host Controller
Linux Kernel Mailing List
[ARM] mmp: avengers lite (pxa168) board bring up
Linux Kernel Mailing List
USB: remove duplicate entry in Option driver and Pl2303 driver for Huawei modem
Linux Kernel Mailing List
ARM: dma-mapping: remove dmac_clean_range and dmac_inv_range
Colocation donated by:
Syndicate