[l10n] Updated Estonian translation
[bug-buddy.git] / src / proccess.c
blob9d004971be5a4eb3fe1497e89650656bb79e98ce
1 /* bug-buddy bug submitting program
3 * Copyright (C) 2006 Fernando Herrera
5 * Author: Fernando Herrera <fherrera@onirica.com>
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of version 2 of the GNU General Public
9 * License as published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
21 #include "proccess.h"
23 #include <glib.h>
25 #include <glibtop/procmem.h>
26 #include <glibtop/proctime.h>
29 char*
30 proccess_get_mem_state (pid_t pid)
32 glibtop_proc_mem proc_mem;
34 glibtop_get_proc_mem (&proc_mem, pid);
36 return g_strdup_printf ("Memory status: size: %" G_GUINT64_FORMAT
37 " vsize: %" G_GUINT64_FORMAT
38 " resident: %" G_GUINT64_FORMAT
39 " share: %" G_GUINT64_FORMAT
40 " rss: %" G_GUINT64_FORMAT
41 " rss_rlim: %" G_GUINT64_FORMAT,
42 proc_mem.size, proc_mem.vsize, proc_mem.resident,
43 proc_mem.share, proc_mem.rss, proc_mem.rss_rlim);
46 char*
47 proccess_get_time (pid_t pid)
49 glibtop_proc_time proc_time;
51 glibtop_get_proc_time (&proc_time, pid);
53 return g_strdup_printf ("CPU usage: start_time: %" G_GUINT64_FORMAT
54 " rtime: %" G_GUINT64_FORMAT
55 " utime: %" G_GUINT64_FORMAT
56 " stime: %" G_GUINT64_FORMAT
57 " cutime:%" G_GUINT64_FORMAT
58 " cstime: %" G_GUINT64_FORMAT
59 " timeout: %" G_GUINT64_FORMAT
60 " it_real_value: %" G_GUINT64_FORMAT
61 " frequency: %" G_GUINT64_FORMAT,
62 proc_time.start_time, proc_time.rtime, proc_time.utime, proc_time.stime,
63 proc_time.cutime, proc_time.cstime, proc_time.timeout, proc_time.it_real_value,
64 proc_time.frequency);