Compare commits

...

6 Commits

Author SHA1 Message Date
Pema Geyleg
e7203ff60b Updated Dzongkha Translation
svn path=/branches/gnome-2-22/; revision=2780
2008-10-06 03:44:06 +00:00
Benoît Dejean
e1b9c9599b Released 2.22.3.
svn path=/branches/gnome-2-22/; revision=2761
2008-06-30 21:46:51 +00:00
Benoît Dejean
41df52e5c4 Handle new /sys/block/.../stat format for linux >= 2.6.25.
Closes #539360.

svn path=/branches/gnome-2-22/; revision=2754
2008-06-22 09:20:59 +00:00
Benoît Dejean
2ec06b3d60 Bumped version number to 2.22.3.
svn path=/branches/gnome-2-22/; revision=2753
2008-06-22 09:09:57 +00:00
Benoît Dejean
e1d6e713fc Released 2.22.2
svn path=/branches/gnome-2-22/; revision=2745
2008-05-23 21:54:03 +00:00
Benoît Dejean
1634698050 Fixed parsing of big /proc/stat for uptime.
Closes #529946.

svn path=/branches/gnome-2-22/; revision=2742
2008-04-29 17:57:01 +00:00
6 changed files with 138 additions and 57 deletions

11
NEWS
View File

@@ -1,3 +1,14 @@
30 June 2008: Overview of changes in 2.22.3
===========================================
* linux:
- Fixed glibtop_get_fsusage with kernel >= 2.6.25.
Closes #539360.
24 May 2008: Overview of changes in 2.22.2
==========================================
* linux:
- fixed parsing of huge /proc/stat.
04 April 2008: Overview of changes in 2.22.1
============================================
* Fixed compilation/dist for !linux.

View File

@@ -4,7 +4,7 @@ dnl
m4_define([libgtop_major_version], [2])
m4_define([libgtop_minor_version], [22])
m4_define([libgtop_micro_version], [1])
m4_define([libgtop_micro_version], [3])
m4_define([libgtop_version], [libgtop_major_version.libgtop_minor_version.libgtop_micro_version])
dnl increment if the interface has additions, changes, removals.

View File

@@ -1,3 +1,7 @@
2008-10-06 Pema Geyleg <pema.geyleg@gmail.com>
* dz.po: Updated Dzongkha Translation
2008-04-04 Eskild Hustvedt <eskildh@gnome.org>
* nn.po: Updated Norwegian Nynorsk translation

109
po/dz.po
View File

@@ -6,9 +6,9 @@ msgid ""
msgstr ""
"Project-Id-Version: libgtop.HEAD\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-05-14 03:41+0100\n"
"PO-Revision-Date: 2006-03-28 11:12-0500\n"
"Last-Translator: \n"
"POT-Creation-Date: 2008-04-23 03:26+0000\n"
"PO-Revision-Date: 2008-10-02 16:50+0530\n"
"Last-Translator: Dawa pemo <daws_403@hotmail.com>\n"
"Language-Team: <en@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -61,144 +61,171 @@ msgid "Invoked from inetd"
msgstr "ཨའི་ཨེན་ཨི་ཊི་ཌི་ནང་ལས་ ལས་བཀོལ་འབད།"
#: ../src/daemon/gnuserv.c:498
#, fuzzy, c-format
#, c-format
msgid "Run '%s --help' to see a full list of available command line options.\n"
msgstr ""
"གདམ་ཁ་%s: %sལུ་འཛོལ་བ། \n"
"འཐོབ་ཚུགས་པའི་ བརྡ་ལམ་གདམ་ཁའི་ ཐོ་ཡིག་ཧྲིལ་བུ་ཅིག་ལུ་ བལྟ་ནིའི་དོན་ལས་ '%s --help' གཡོག་བཀོལ།\n"
msgstr "འཐོབ་ཚུགས་པའི་ བརྡ་བཀོད་ གྲལ་ཐིག་ གདམ་ཁ་ཚུ་ བལྟ་ནིའི་དོན་ལུ་ '%s --help' གཡོག་བཀོལ། \n"
#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27
#: ../sysdeps/osf1/siglist.c:27
#: ../sysdeps/sun4/siglist.c:27
msgid "Hangup"
msgstr "ཐོགས་རྐྱེན།"
#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28
#: ../sysdeps/osf1/siglist.c:28
#: ../sysdeps/sun4/siglist.c:28
msgid "Interrupt"
msgstr "བར་ཆད།"
#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29
#: ../sysdeps/osf1/siglist.c:29
#: ../sysdeps/sun4/siglist.c:29
msgid "Quit"
msgstr "སྤངས།"
#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30
#: ../sysdeps/osf1/siglist.c:30
#: ../sysdeps/sun4/siglist.c:30
msgid "Illegal instruction"
msgstr "ཁྲིམས་འགལ་བཀོད་རྒྱ།"
#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31
#: ../sysdeps/osf1/siglist.c:31
#: ../sysdeps/sun4/siglist.c:31
msgid "Trace trap"
msgstr "ཧིང་ རྗེས་འཚོལ་འབད།"
#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32
#: ../sysdeps/osf1/siglist.c:32
#: ../sysdeps/sun4/siglist.c:32
msgid "Abort"
msgstr "བར་བཤོལ་འབད།"
#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33
#: ../sysdeps/osf1/siglist.c:33
#: ../sysdeps/sun4/siglist.c:33
msgid "EMT error"
msgstr "ཨི་ཨེམ་ཊི་འཛོལ་བ།"
#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34
#: ../sysdeps/osf1/siglist.c:34
#: ../sysdeps/sun4/siglist.c:34
msgid "Floating-point exception"
msgstr "ལྡིང་ཚད་དམིགས་བསལ།"
#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35
#: ../sysdeps/osf1/siglist.c:35
#: ../sysdeps/sun4/siglist.c:35
msgid "Kill"
msgstr "གསད།"
#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36
#: ../sysdeps/osf1/siglist.c:36
#: ../sysdeps/sun4/siglist.c:36
msgid "Bus error"
msgstr "བརྡ་རྟགས་འགྲུལ་ལམ་གྱི་འཛོལ་བ།"
#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37
#: ../sysdeps/osf1/siglist.c:37
#: ../sysdeps/sun4/siglist.c:37
msgid "Segmentation violation"
msgstr "ཆ་བགོ་བའི་འགལ་བ།"
#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38
#: ../sysdeps/osf1/siglist.c:38
#: ../sysdeps/sun4/siglist.c:38
msgid "Bad argument to system call"
msgstr "རིམ་ལུགས་བོད་བརྡ་ལུ་ སྒྲུབ་རྟགས་བྱང་ཉེས།"
#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39
#: ../sysdeps/osf1/siglist.c:39
#: ../sysdeps/sun4/siglist.c:39
msgid "Broken pipe"
msgstr "རྒྱུད་དུང་ཆད་པ།"
#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40
#: ../sysdeps/osf1/siglist.c:40
#: ../sysdeps/sun4/siglist.c:40
msgid "Alarm clock"
msgstr "འཇིགས་བརྡ་ཆེ་འཁོར།"
#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41
#: ../sysdeps/osf1/siglist.c:41
#: ../sysdeps/sun4/siglist.c:41
msgid "Termination"
msgstr "རྩ་གྲོལ།"
#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42
#: ../sysdeps/osf1/siglist.c:42
#: ../sysdeps/sun4/siglist.c:42
msgid "Urgent condition on socket"
msgstr "སོཀ་ཀེཊི་ལུ་ འཕྲལ་མཁོའི་གནས་སྟངས།"
#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43
#: ../sysdeps/osf1/siglist.c:43
#: ../sysdeps/sun4/siglist.c:43
msgid "Stop"
msgstr "བཀག"
#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44
#: ../sysdeps/osf1/siglist.c:44
#: ../sysdeps/sun4/siglist.c:44
msgid "Keyboard stop"
msgstr "ལྡེ་སྒྲོམ་བཀག"
#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45
#: ../sysdeps/osf1/siglist.c:45
#: ../sysdeps/sun4/siglist.c:45
msgid "Continue"
msgstr "འཕྲོ་མཐུད།"
#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46
#: ../sysdeps/osf1/siglist.c:46
#: ../sysdeps/sun4/siglist.c:46
msgid "Child status has changed"
msgstr "རྩ་ལག་གི་གནས་ཚད་ བསྒྱུར་བཅོས་ཡར་སོ་ནུག"
#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47
#: ../sysdeps/osf1/siglist.c:47
#: ../sysdeps/sun4/siglist.c:47
msgid "Background read from tty"
msgstr "ཊི་ཊི་ཝའི་ནང་ལས་ རྒྱབ་གཞི་ལྷག་ཡོད།"
#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48
#: ../sysdeps/osf1/siglist.c:48
#: ../sysdeps/sun4/siglist.c:48
msgid "Background write to tty"
msgstr "ཊི་ཊི་ཝའི་ལུ་ རྒྱབ་གཞི་བྲིས།"
#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49
#: ../sysdeps/osf1/siglist.c:49
#: ../sysdeps/sun4/siglist.c:49
msgid "I/O now possible"
msgstr "ཨའི་/ཨོ་ ད་ལྟོ་ཚུགས་པས།"
#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50
#: ../sysdeps/osf1/siglist.c:50
#: ../sysdeps/sun4/siglist.c:50
msgid "CPU limit exceeded"
msgstr "ལས་སྦྱོར་ལྟེ་བའི་ཚད་ལས་ ལྷག་སོ་ནུག"
#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51
#: ../sysdeps/osf1/siglist.c:51
#: ../sysdeps/sun4/siglist.c:51
msgid "File size limit exceeded"
msgstr "ཡིག་སྣོད་ཀྱི་ཚད་ལས་ ལྷག་སོ་ནུག"
#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52
#: ../sysdeps/osf1/siglist.c:52
#: ../sysdeps/sun4/siglist.c:52
msgid "Virtual alarm clock"
msgstr "བར་ཅུ་ཡེལ་ འཇིགས་བརྡའི་ཆེ་འཁོར།"
#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53
#: ../sysdeps/osf1/siglist.c:53
#: ../sysdeps/sun4/siglist.c:53
msgid "Profiling alarm clock"
msgstr "གསལ་སྡུད་འཇིགས་བརྡའི་ཆེ་འཁོར།"
#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54
#: ../sysdeps/osf1/siglist.c:54
#: ../sysdeps/sun4/siglist.c:54
msgid "Window size change"
msgstr "སྒོ་སྒྲིག་ཚད་ཀྱི་བསྒྱུར་བཅོས།"
#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55
#: ../sysdeps/osf1/siglist.c:55
#: ../sysdeps/sun4/siglist.c:55
msgid "Information request"
msgstr "བརྡ་དོན་གྱི་ཞུ་བ།"
#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56
#: ../sysdeps/osf1/siglist.c:56
#: ../sysdeps/sun4/siglist.c:56
msgid "User defined signal 1"
msgstr "ལག་ལེན་པའི་ ངེས་འཛིན་བརྡ་རྟགས་ ༡པ།"
#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57
#: ../sysdeps/osf1/siglist.c:57
#: ../sysdeps/sun4/siglist.c:57
msgid "User defined signal 2"
msgstr "ལག་ལེན་པའི་ངེས་འཛིན་བརྡ་རྟགས་ ༢པ།"
#~ msgid "DEBUG"
#~ msgstr "རྐྱེན་སེལ།"
#~ msgid "VERBOSE"
#~ msgstr "ཚིག་མང་།"
#~ msgid "NO-DAEMON"
#~ msgstr "ཌེ་མཱོན་མིན་འདུག"
#~ msgid "INETD"
#~ msgstr "ཨའི་ཨེན་ཨི་ཊི་ཌི།"

View File

@@ -59,9 +59,35 @@ get_partition(const char *mountpoint)
}
/*
Bug #539360.
/sys/.../stat format is partially defined in
linux/Documentation/block/stat.txt (looks outdated). Before linux
2.5.25, /sys/block/%s/stat and /sys/block/%s/%s/stat were not the
same, but the following commit changed the latter to have the same
format and broke compatibility.
Commit 34e8beac92c27d292938065f8375842d2840767c
Author: Jerome Marchand <jmarchan@redhat.com>
Date: Fri Feb 8 11:04:55 2008 +0100
Enhanced partition statistics: sysfs
Reports enhanced partition statistics in sysfs.
Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
fs/partitions/check.c | 22 +++++++++++++++++++---
1 files changed, 19 insertions(+), 3 deletions(-)
*/
static void
get_sys_path(const char *device, char **stat_path, const char **parse_format)
get_sys_path(glibtop* server, const char *device, char **stat_path, const char **parse_format)
{
const char* linux_2_6_25_format = "%*llu %*llu %llu %*llu"
"%*llu %*llu %llu %*llu";
if(g_str_has_prefix(device, "hd") || g_str_has_prefix(device, "sd"))
{
char *prefix;
@@ -79,12 +105,18 @@ get_sys_path(const char *device, char **stat_path, const char **parse_format)
g_free(prefix);
*stat_path = path;
*parse_format = "%*llu %llu %*llu %llu";
if (server->os_version_code < LINUX_VERSION_CODE(2, 6, 25))
*parse_format = "%*llu %llu %*llu %llu";
else
*parse_format = linux_2_6_25_format;
}
else
{
*stat_path = g_strdup_printf("/sys/block/%s/stat", device);
*parse_format = "%*llu %*llu %llu %*llu %*llu %*llu %llu";
if (server->os_version_code < LINUX_VERSION_CODE(2, 6, 25))
*parse_format = "%*llu %*llu %llu %*llu %*llu %*llu %llu";
else
*parse_format = linux_2_6_25_format;
}
}
@@ -101,7 +133,7 @@ static void linux_2_6_0(glibtop *server, glibtop_fsusage *buf, const char *path)
device = get_partition(path);
if(!device) return;
get_sys_path(device, &filename, &format);
get_sys_path(server, device, &filename, &format);
g_free(device);
ret = try_file_to_buffer(buffer, sizeof buffer, filename);

View File

@@ -119,20 +119,27 @@ file_to_buffer(glibtop *server, char *buffer, size_t bufsiz, const char *filenam
static unsigned long
read_boot_time(glibtop *server)
{
char buffer[BUFSIZ];
char *btime;
char* line = NULL;
size_t size = 0;
FILE* stat;
unsigned long btime = 0;
file_to_buffer(server, buffer, sizeof buffer, "/proc/stat");
btime = strstr(buffer, "btime");
if (!btime) {
glibtop_warn_io_r(server, "cannot find btime in /proc/stat");
return 0UL;
if (!(stat = fopen("/proc/stat", "r"))) {
glibtop_error_io_r(server, "fopen(\"/proc/stat\")");
goto out;
}
btime = skip_token(btime);
return strtoul(btime, NULL, 10);
while (getline(&line, &size, stat) != -1) {
if (!strncmp(line, "btime", 5)) {
btime = strtoul(skip_token(line), NULL, 10);
break;
}
}
free(line);
fclose(stat);
out:
return btime;
}