Hello community,
here is the log from the commit of package spu-tools
checked in at Fri Oct 24 15:30:17 CEST 2008.
--------
--- spu-tools/spu-tools.changes 2008-08-20 15:57:25.000000000 +0200
+++ /mounts/work_src_done/STABLE/spu-tools/spu-tools.changes 2008-10-23 18:07:37.000000000 +0200
@@ -1,0 +2,5 @@
+Thu Oct 23 18:06:23 CEST 2008 - sassmann@suse.de
+
+- update spu-tools to version 2.3.0 (bnc#438245)
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
spu-tools-2.2.80.tar.bz2
New:
----
spu-tools-2.3.0.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ spu-tools.spec ++++++
--- /var/tmp/diff_new_pack.c13617/_old 2008-10-24 15:29:55.000000000 +0200
+++ /var/tmp/diff_new_pack.c13617/_new 2008-10-24 15:29:55.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package spu-tools (Version 2.2.80)
+# spec file for package spu-tools (Version 2.3.0)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -19,8 +19,8 @@
Name: spu-tools
-Version: 2.2.80
-Release: 11
+Version: 2.3.0
+Release: 1
Url: http://sourceforge.net/projects/libspe
Summary: User space tools for Cell/B.E.
License: GPL v2 only
@@ -60,6 +60,8 @@
%_mandir/man1/spu-ps.1.gz
%changelog
+* Thu Oct 23 2008 sassmann@suse.de
+- update spu-tools to version 2.3.0 (bnc#438245)
* Wed Aug 20 2008 meissner@suse.de
- use rpm_opt_flags
* Tue Aug 05 2008 sassmann@suse.de
++++++ spu-tools-2.2.80.tar.bz2 -> spu-tools-2.3.0.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/spu-tools-2.2.80/ChangeLog new/spu-tools-2.3.0/ChangeLog
--- old/spu-tools-2.2.80/ChangeLog 2008-05-08 15:18:51.000000000 +0200
+++ new/spu-tools-2.3.0/ChangeLog 2008-07-17 09:33:51.000000000 +0200
@@ -1,3 +1,9 @@
+2008-07-04 Andre Detsch
+ * ctx-info.c: Support for spu threads with arbitrary spufs entry names.
+
+2008-05-28 Andre Detsch
+ * spu-top: Added TID field to SPU view.
+
2008-04-11 Andre Detsch
* spu-top.c: Fix escape sequences handling.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/spu-tools-2.2.80/ctx-info.c new/spu-tools-2.3.0/ctx-info.c
--- old/spu-tools-2.2.80/ctx-info.c 2007-10-12 15:55:44.000000000 +0200
+++ new/spu-tools-2.3.0/ctx-info.c 2008-07-17 09:33:51.000000000 +0200
@@ -279,39 +279,70 @@
}
-static struct ctx *ctxs_get_ctx(int pid, int cid)
+static struct ctx *ctxs_get_ctx(int thread_id)
{
int i;
/* This could be optimized by using a hash table */
for (i = 0; i < ctxs_n; i++) {
- if (ctxs[i]->ppu_pid == pid &&
- cid == ctxs[i]->context_id)
+ if (ctxs[i]->thread_id == thread_id)
return ctxs[i];
}
return NULL;
}
+static int find_thread_pid(int thread_id)
+{
+ DIR* proc_dir;
+ struct dirent *entry;
+ static char buf[PATH_MAX];
+ int pid = -1;
+
+ proc_dir = opendir(PROCFS_PATH);
+ if (proc_dir) {
+ while ((entry = readdir(proc_dir)) != NULL) {
+ sprintf(buf, "%s/%s/task/%d", PROCFS_PATH, entry->d_name, thread_id);
+ if (access(buf, F_OK) == 0) {
+ sscanf(entry->d_name, "%d", &pid);
+ break;
+ }
+ }
+ closedir(proc_dir);
+ }
+ return pid;
+}
+
static int
process_ctx_entry(struct dirent *entry, const char *gang_name, u64 last_period)
{
- char buf[PATH_MAX];
+ static char buf[PATH_MAX];
FILE *fp;
- int uid, pid;
- u64 context_id;
+ int uid, thread_id;
struct ctx *ctx;
- sscanf(entry->d_name, "spethread-%d-%llu", &pid, &context_id);
+ if (gang_name)
+ sprintf(buf, "%s/%s/%s", SPUFS_PATH, gang_name, entry->d_name);
+ else
+ sprintf(buf, "%s/%s", SPUFS_PATH, entry->d_name);
+ chdir(buf);
- ctx = ctxs_get_ctx(pid, context_id);
+ fp = fopen("tid", "r");
+ if (fp) {
+ fscanf(fp, "%d", &thread_id);
+ fclose(fp);
+ } else {
+ return 0;
+ }
+
+ ctx = ctxs_get_ctx(thread_id);
if (!ctx) {
ctxs_ensure_capacity(ctxs_n + 1);
ctx = alloc_ctx();
ctxs[ctxs_n] = ctx;
ctxs_n++;
- ctx->ppu_pid = pid;
- ctx->context_id = context_id;
+ ctx->thread_id = thread_id;
+ ctx->ppu_pid = find_thread_pid(thread_id);
}
sprintf(buf, "%s/%d/stat", PROCFS_PATH, ctx->ppu_pid);
@@ -338,12 +369,6 @@
fclose(fp);
}
- if (gang_name)
- sprintf(buf, "%s/%s/%s", SPUFS_PATH, gang_name, entry->d_name);
- else
- sprintf(buf, "%s/%s", SPUFS_PATH, entry->d_name);
- chdir(buf);
-
if (access("phys-id", R_OK) != 0) {
ctx->spe = SPE_UNKNOWN;
} else {
@@ -354,14 +379,6 @@
}
}
- fp = fopen("tid", "r");
- if (fp) {
- fscanf(fp, "%d", &ctx->thread_id);
- fclose(fp);
- } else {
- ctx->thread_id = -1;
- }
-
fp = fopen("stat", "r");
if (fp) {
u64 last_time;
@@ -428,7 +445,7 @@
struct dirent *entry, *gang_entry;
DIR *ctxs_dir, *gang_dir;
int i;
- char buf[PATH_MAX];
+ static char buf[PATH_MAX];
ctxs_dir = opendir(SPUFS_PATH);
if (!ctxs_dir)
@@ -438,15 +455,17 @@
ctxs[i]->updated = 0;
while ((entry = readdir(ctxs_dir)) != NULL) {
- if (!strncmp(entry->d_name, "spethread-", 10)) {
+ sprintf(buf, "%s/%s/stat", SPUFS_PATH, entry->d_name);
+ if (access(buf, F_OK) == 0) {
process_ctx_entry(entry, NULL, last_period);
- } else if (!strncmp(entry->d_name, "gang-", 5)) {
+ } else {
/* contexts within a gang */
sprintf(buf, "%s/%s", SPUFS_PATH, entry->d_name);
gang_dir = opendir(buf);
if (gang_dir) {
while ((gang_entry = readdir(gang_dir)) != NULL) {
- if (!strncmp(gang_entry->d_name, "spethread-", 10))
+ sprintf(buf, "%s/%s/%s/stat", SPUFS_PATH, entry->d_name, gang_entry->d_name);
+ if (access(buf, F_OK) == 0)
process_ctx_entry(gang_entry, entry->d_name, last_period);
}
closedir(gang_dir);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/spu-tools-2.2.80/spu-info.c new/spu-tools-2.3.0/spu-info.c
--- old/spu-tools-2.2.80/spu-info.c 2008-03-14 15:35:36.000000000 +0100
+++ new/spu-tools-2.3.0/spu-info.c 2008-06-05 16:22:49.000000000 +0200
@@ -105,6 +105,9 @@
case SPU_PPE_LIBRARY:
ret = p1->ppe_library - p2->ppe_library; break;
+ case SPU_CTX_THREAD_ID:
+ ret = p1->ctx_thread_id - p2->ctx_thread_id; break;
+
default :
ret = 0; break;
}
@@ -218,6 +221,8 @@
{ SPU_CLASS2_INTERRUPTS, "IRQ2", "%6s", "%6llu", "Number of Class2 Interrupts Received", 1, "" },
{ SPU_PPE_LIBRARY, "PPE_LIB", "%8s", "%8llu", "Number of PPE Assisted Library Calls Performed", 1, "" },
+ { SPU_CTX_THREAD_ID, "TID", "%6s", "%6d", "SPE Controlling Thread ID", 0, "" },
+
{ 0, NULL, NULL, NULL, NULL, 0 }
};
@@ -253,9 +258,33 @@
return sprintf(buf, format, spu->class2_interrupts);
case SPU_PPE_LIBRARY:
return sprintf(buf, format, spu->ppe_library);
+
+ case SPU_CTX_THREAD_ID:
+ return sprintf(buf, format, spu->ctx_thread_id);
+
default:
return 0;
}
}
+void fill_spus_tids(struct spu** spus, struct ctx** ctxs)
+{
+ int i, j;
+
+ for (j = 0; spus[j]; j++)
+ spus[j]->ctx_thread_id = 0;
+
+ for (i = 0; ctxs[i]; i++) {
+ int spe = ctxs[i]->spe;
+ if (spe < 0)
+ continue;
+
+ for (j = 0; spus[j]; j++) {
+ if (spus[j]->number == spe) {
+ spus[j]->ctx_thread_id = ctxs[i]->thread_id;
+ break;
+ }
+ }
+ }
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/spu-tools-2.2.80/spu-tools.h new/spu-tools-2.3.0/spu-tools.h
--- old/spu-tools-2.2.80/spu-tools.h 2007-10-12 15:55:44.000000000 +0200
+++ new/spu-tools-2.3.0/spu-tools.h 2008-07-17 09:33:51.000000000 +0200
@@ -91,7 +91,6 @@
};
struct ctx {
- u64 context_id;
int ppu_pid;
int thread_id;
const char *user;
@@ -148,6 +147,7 @@
SPU_MAJOR_PAGE_FAULTS,
SPU_CLASS2_INTERRUPTS,
SPU_PPE_LIBRARY,
+ SPU_CTX_THREAD_ID,
SPU_MAX_FIELD
};
@@ -169,6 +169,8 @@
u64 ppe_library;
float percent[TIME_MAX];
+
+ int ctx_thread_id;
};
@@ -183,6 +185,7 @@
inline void set_spu_sort_field(enum spu_field_id field);
void set_spu_sort_descending(int descending);
+void fill_spus_tids(struct spu** spus, struct ctx** ctxs);
/*
* PER_PROC
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/spu-tools-2.2.80/spu-top.c new/spu-tools-2.3.0/spu-top.c
--- old/spu-tools-2.2.80/spu-top.c 2008-05-08 15:18:51.000000000 +0200
+++ new/spu-tools-2.3.0/spu-top.c 2008-06-05 16:22:49.000000000 +0200
@@ -443,6 +443,7 @@
spus = get_spus();
ctxs = get_spu_contexts(period);
procs = get_procs(ctxs);
+ fill_spus_tids(spus, ctxs);
last_time = current_time;
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org