[lemona commit] r446 - in trunk: driver driver/blades patchs tools/picker/blades/console

1 view
Skip to first unread message

codesite...@google.com

unread,
Dec 18, 2008, 12:57:53 AM12/18/08
to lemon...@googlegroups.com
Author: barratis
Date: Wed Dec 17 21:56:26 2008
New Revision: 446

Added:
trunk/tools/picker/blades/console/_llseek.py
trunk/tools/picker/blades/console/openat.py
Modified:
trunk/driver/blades/iovec.c
trunk/driver/blades/string.c
trunk/driver/lemona_blades.h
trunk/driver/logging.c
trunk/driver/mixers.c
trunk/patchs/patch-2.6.26.3
trunk/patchs/patch-2.6.26.3.partial
trunk/tools/picker/blades/console/__init__.py
trunk/tools/picker/blades/console/close.py
trunk/tools/picker/blades/console/lseek.py
trunk/tools/picker/blades/console/open.py

Log:
- driver changes
- fixed read family patches, argument passed to lemona_log_out were
incorrect
- fixed lemona_zest_get_size to correctly set the isExt argument while
calling a blade
- fixed lemona_zest_fill to pass the correct index used for argument
size
- patched sys_readv & sys_writev

- picker tool changes
- fixed console/{open,close,lseek} handler output
- added handler for console/{openat, __llseek}
- update console backend PrintBuffer method to a nicer output

- TODO
- implement lemona_blade_iovec



Modified: trunk/driver/blades/iovec.c
==============================================================================
--- trunk/driver/blades/iovec.c (original)
+++ trunk/driver/blades/iovec.c Wed Dec 17 21:56:26 2008
@@ -36,8 +36,8 @@
* NOTE: As you would have guessed this is a dual blade.
*/
int lemona_blade_iovec(struct lemona_zest *zest,
- int isExt, int idx, int off,
- void *iov, void *vlen)
+ int isExt, int idx, int off,
+ void *iov, void *vlen)
{
/* TODO: code lemona_blade_iovec */
return (0);

Modified: trunk/driver/blades/string.c
==============================================================================
--- trunk/driver/blades/string.c (original)
+++ trunk/driver/blades/string.c Wed Dec 17 21:56:26 2008
@@ -76,7 +76,7 @@
int isExt, int idx, int off,
void *pfd, void *unused)
{
- long fd = *((long *)pfd);
+ long fd = *((long *)pfd);
int size = 0;
struct file *file;
struct dentry *dentry;
@@ -99,7 +99,6 @@
size += (int)dentry->d_name.len + (size ? 1 : 0);
dentry = dentry->d_parent;
}
-
fput_light(file, fput_needed);
return (size + 1); /* add '/' (i.e. root path) */
}
@@ -113,7 +112,7 @@
if (size)
dest[size++] = '/';
strncpy(dest + size, dentry->d_name.name, dentry->d_name.len);
- size += (int)dentry->d_name.len;
+ size += (int)dentry->d_name.len;
dentry = dentry->d_parent;
}
/* add '/' (i.e. root path) */

Modified: trunk/driver/lemona_blades.h
==============================================================================
--- trunk/driver/lemona_blades.h (original)
+++ trunk/driver/lemona_blades.h Wed Dec 17 21:56:26 2008
@@ -56,4 +56,11 @@
int isExt, int idx, int off,
void __user *str, void *unused);

+/*
+ * from blades/iovec.c
+ */
+int lemona_blade_iovec(struct lemona_zest *zest,
+ int isExt, int idx, int off,
+ void *iov, void *vlen);
+
#endif

Modified: trunk/driver/logging.c
==============================================================================
--- trunk/driver/logging.c (original)
+++ trunk/driver/logging.c Wed Dec 17 21:56:26 2008
@@ -51,6 +51,7 @@
int j = 0;
int tmp = 0;
int size = 0;
+ int argnr = 0;
int bladesnr;
const struct __lemona_mixer_handler *handlers;
void *arg1, *arg2;
@@ -60,11 +61,13 @@

if (in == true)
{
+ argnr = mixer->in.argnr;
handlers = mixer->in.handlers;
bladesnr = mixer->in.argnr + mixer->in.extnr;
}
else
{
+ argnr = mixer->out.argnr;
handlers = mixer->out.handlers;
bladesnr = mixer->out.argnr + mixer->out.extnr;
}
@@ -83,10 +86,10 @@
if (handlers[i].dual == true)
{
arg2 = va_arg(ap, void*);
- tmp = handlers[i].blade(NULL, false, i, 0, arg1, arg2);
+ tmp = handlers[i].blade(NULL, i > argnr, -1, 0, arg1, arg2);
}
else
- tmp = handlers[i].blade(NULL, false, i, 0, arg1, NULL);
+ tmp = handlers[i].blade(NULL, i > argnr, -1, 0, arg1, NULL);
if (tmp < 0)
{
lemona_printk("lemona_zest_get_size: "
@@ -176,10 +179,10 @@
if (handlers[i].dual == true)
{
arg2 = va_arg(ap, void*);
- ret = handlers[i].blade(z, false, i, off, arg1, arg2);
+ ret = handlers[i].blade(z, false, j, off, arg1, arg2);
}
else
- ret = handlers[i].blade(z, false, i, off, arg1, NULL);
+ ret = handlers[i].blade(z, false, j, off, arg1, NULL);
if (ret < 0)
{
lemona_printk("args (syscal %i) in: %i blade %i returned -1\n",
@@ -202,10 +205,10 @@
if (handlers[i].dual == true)
{
arg2 = va_arg(ap, void*);
- ret = handlers[i].blade(z, true, i, off, arg1, arg2);
+ ret = handlers[i].blade(z, true, j, off, arg1, arg2);
}
else
- ret = handlers[i].blade(z, true, i, off, arg1, NULL);
+ ret = handlers[i].blade(z, true, j, off, arg1, NULL);
if (ret < 0)
{
lemona_printk("exts (syscal %i) in: %i blade %i returned %i\n",

Modified: trunk/driver/mixers.c
==============================================================================
--- trunk/driver/mixers.c (original)
+++ trunk/driver/mixers.c Wed Dec 17 21:56:26 2008
@@ -2435,7 +2435,7 @@
.handlers = {
/* fd */
{ .dual = false , .blade = lemona_blade_integer },
- /* offset_hight */
+ /* offset_high */
{ .dual = false , .blade = lemona_blade_long },
/* offset_low */
{ .dual = false , .blade = lemona_blade_long },
@@ -2529,34 +2529,36 @@
{
.sysnr = __NR_readv,
.in = {
- .argnr = -1,
- .extnr = -1,
+ .argnr = 1,
+ .extnr = 0,
.handlers = {
- { .dual = true, .blade = NULL },
+ { .dual = false , .blade = lemona_blade_long },
}
},
.out = {
- .argnr = -1,
- .extnr = -1,
+ .argnr = 3,
+ .extnr = 0,
.handlers = {
- { .dual = false, .blade = NULL },
+ { .dual = false , .blade = lemona_blade_integer },
+ { .dual = true , .blade = lemona_blade_iovec },
},
}
},
{
.sysnr = __NR_writev,
.in = {
- .argnr = -1,
- .extnr = -1,
+ .argnr = 3,
+ .extnr = 0,
.handlers = {
- { .dual = true, .blade = NULL },
+ { .dual = false , .blade = lemona_blade_long },
+ { .dual = true , .blade = lemona_blade_iovec },
}
},
.out = {
- .argnr = -1,
- .extnr = -1,
+ .argnr = 1,
+ .extnr = 0,
.handlers = {
- { .dual = false, .blade = NULL },
+ { .dual = false , .blade = lemona_blade_integer },
},
}
},

Modified: trunk/patchs/patch-2.6.26.3
==============================================================================
--- trunk/patchs/patch-2.6.26.3 (original)
+++ trunk/patchs/patch-2.6.26.3 Wed Dec 17 21:56:26 2008
@@ -29,7 +29,7 @@
/*
diff -uNr linux.vanilla/fs/namei.c linux.patch/fs/namei.c
--- linux.vanilla/fs/namei.c 2008-09-27 17:26:10.000000000 +1000
-+++ linux.patch/fs/namei.c 2008-12-08 13:30:26.000000000 +1100
++++ linux.patch/fs/namei.c 2008-12-18 16:33:47.000000000 +1100
@@ -34,6 +34,9 @@
#include <asm/namei.h>
#include <asm/uaccess.h>
@@ -260,7 +260,7 @@

diff -uNr linux.vanilla/fs/open.c linux.patch/fs/open.c
--- linux.vanilla/fs/open.c 2008-09-27 17:26:11.000000000 +1000
-+++ linux.patch/fs/open.c 2008-12-08 13:30:20.000000000 +1100
++++ linux.patch/fs/open.c 2008-12-18 16:33:38.000000000 +1100
@@ -30,6 +30,8 @@
#include <linux/audit.h>
#include <linux/falloc.h>
@@ -347,7 +347,7 @@
EXPORT_SYMBOL(sys_close);
diff -uNr linux.vanilla/fs/read_write.c linux.patch/fs/read_write.c
--- linux.vanilla/fs/read_write.c 2008-09-27 17:26:11.000000000 +1000
-+++ linux.patch/fs/read_write.c 2008-12-08 13:30:11.000000000 +1100
++++ linux.patch/fs/read_write.c 2008-12-18 16:33:27.000000000 +1100
@@ -21,6 +21,9 @@
#include <asm/uaccess.h>
#include <asm/unistd.h>
@@ -382,7 +382,7 @@
bad:
+ lemona_block_start {
+ if (lemona_file == false)
-+ lemona_log_out(__NR_lseek, false, 1, 0, &retval);
++ lemona_log_out(__NR_lseek, 1, 0, &retval);
+ } lemona_block_end;
return retval;
}
@@ -445,7 +445,7 @@

+ lemona_block_start {
+ if (lemona_file == false)
-+ lemona_log_out(__NR_read, false, 2, 0, buf, &ret);
++ lemona_log_out(__NR_read, 2, 0, buf, &ret);
+ } lemona_block_end;
return ret;
}
@@ -508,7 +508,7 @@

+ lemona_block_start {
+ if (lemona_file == false)
-+ lemona_log_out(__NR_pread64, false, 2, 0, buf, &ret);
++ lemona_log_out(__NR_pread64, 2, 0, buf, &ret);
+ } lemona_block_end;
return ret;
}
@@ -548,6 +548,59 @@
return ret;
}

+@@ -659,8 +734,18 @@
+ struct file *file;
+ ssize_t ret = -EBADF;
+ int fput_needed;
++#if defined(LEMONA)
++ bool lemona_file = false;
++#endif
+
+ file = fget_light(fd, &fput_needed);
++
++ lemona_block_start {
++ if (file == NULL
++ || !(lemona_file = lemona_relay_is_ours(file->f_dentry)))
++ lemona_log_in(__NR_readv, 1, 0, &fd);
++ } lemona_block_end;
++
+ if (file) {
+ loff_t pos = file_pos_read(file);
+ ret = vfs_readv(file, vec, vlen, &pos);
+@@ -671,6 +756,11 @@
+ if (ret > 0)
+ add_rchar(current, ret);
+ inc_syscr(current);
++
++ lemona_block_start {
++ if (lemona_file == false)
++ lemona_log_out(__NR_readv, 3, 0, &ret, vec, vlen);
++ } lemona_block_end;
+ return ret;
+ }
+
+@@ -681,6 +771,10 @@
+ ssize_t ret = -EBADF;
+ int fput_needed;
+
++ lemona_block_start {
++ lemona_log_in(__NR_writev, 3, 0, &fd, vec, &vlen);
++ } lemona_block_end;
++
+ file = fget_light(fd, &fput_needed);
+ if (file) {
+ loff_t pos = file_pos_read(file);
+@@ -692,6 +786,10 @@
+ if (ret > 0)
+ add_wchar(current, ret);
+ inc_syscw(current);
++
++ lemona_block_start {
++ lemona_log_out(__NR_writev, 1, 0, &ret);
++ } lemona_block_end;
+ return ret;
+ }
+
diff -uNr linux.vanilla/init/main.c linux.patch/init/main.c
--- linux.vanilla/init/main.c 2008-09-27 17:26:15.000000000 +1000
+++ linux.patch/init/main.c 2008-12-08 13:33:03.000000000 +1100
@@ -609,7 +662,7 @@
rq->nr_switches++;
diff -uNr linux.vanilla/lemona/blades/generics.c
linux.patch/lemona/blades/generics.c
--- linux.vanilla/lemona/blades/generics.c 1970-01-01 10:00:00.000000000
+1000
-+++ linux.patch/lemona/blades/generics.c 2008-12-08 13:40:16.000000000
+1100
++++ linux.patch/lemona/blades/generics.c 2008-12-18 16:32:36.000000000
+1100
@@ -0,0 +1,209 @@
+/*
+** This file is part of Lemona.
@@ -822,7 +875,7 @@
+}
diff -uNr linux.vanilla/lemona/blades/iovec.c
linux.patch/lemona/blades/iovec.c
--- linux.vanilla/lemona/blades/iovec.c 1970-01-01 10:00:00.000000000 +1000
-+++ linux.patch/lemona/blades/iovec.c 2008-12-08 13:40:16.000000000 +1100
++++ linux.patch/lemona/blades/iovec.c 2008-12-18 16:32:36.000000000 +1100
@@ -0,0 +1,44 @@
+/*
+** This file is part of Lemona.
@@ -862,16 +915,16 @@
+ * NOTE: As you would have guessed this is a dual blade.
+ */
+int lemona_blade_iovec(struct lemona_zest *zest,
-+ int isExt, int idx, int off,
-+ void *iov, void *vlen)
++ int isExt, int idx, int off,
++ void *iov, void *vlen)
+{
+ /* TODO: code lemona_blade_iovec */
+ return (0);
+}
diff -uNr linux.vanilla/lemona/blades/string.c
linux.patch/lemona/blades/string.c
--- linux.vanilla/lemona/blades/string.c 1970-01-01 10:00:00.000000000
+1000
-+++ linux.patch/lemona/blades/string.c 2008-12-08 13:40:16.000000000 +1100
-@@ -0,0 +1,124 @@
++++ linux.patch/lemona/blades/string.c 2008-12-18 16:32:36.000000000 +1100
+@@ -0,0 +1,123 @@
+/*
+** This file is part of Lemona.
+** Copyright (C) 2008 Kenfe-Micka�l Laventure
@@ -950,7 +1003,7 @@
+ int isExt, int idx, int off,
+ void *pfd, void *unused)
+{
-+ long fd = *((long *)pfd);
++ long fd = *((long *)pfd);
+ int size = 0;
+ struct file *file;
+ struct dentry *dentry;
@@ -973,7 +1026,6 @@
+ size += (int)dentry->d_name.len + (size ? 1 : 0);
+ dentry = dentry->d_parent;
+ }
-+
+ fput_light(file, fput_needed);
+ return (size + 1); /* add '/' (i.e. root path) */
+ }
@@ -987,7 +1039,7 @@
+ if (size)
+ dest[size++] = '/';
+ strncpy(dest + size, dentry->d_name.name, dentry->d_name.len);
-+ size += (int)dentry->d_name.len;
++ size += (int)dentry->d_name.len;
+ dentry = dentry->d_parent;
+ }
+ /* add '/' (i.e. root path) */
@@ -998,7 +1050,7 @@
+}
diff -uNr linux.vanilla/lemona/COPYING linux.patch/lemona/COPYING
--- linux.vanilla/lemona/COPYING 1970-01-01 10:00:00.000000000 +1000
-+++ linux.patch/lemona/COPYING 2008-12-08 13:40:16.000000000 +1100
++++ linux.patch/lemona/COPYING 2008-12-18 16:32:36.000000000 +1100
@@ -0,0 +1,4 @@
+This software is released under both the MIT and GPL license, the
+content of these licenses can be found respectively in the MIT.LICENSE
@@ -1006,7 +1058,7 @@
+
diff -uNr linux.vanilla/lemona/GPL.LICENSE linux.patch/lemona/GPL.LICENSE
--- linux.vanilla/lemona/GPL.LICENSE 1970-01-01 10:00:00.000000000 +1000
-+++ linux.patch/lemona/GPL.LICENSE 2008-12-08 13:40:16.000000000 +1100
++++ linux.patch/lemona/GPL.LICENSE 2008-12-18 16:32:36.000000000 +1100
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
@@ -1349,7 +1401,7 @@
+Public License instead of this License.
diff -uNr linux.vanilla/lemona/init.c linux.patch/lemona/init.c
--- linux.vanilla/lemona/init.c 1970-01-01 10:00:00.000000000 +1000
-+++ linux.patch/lemona/init.c 2008-12-08 13:40:16.000000000 +1100
++++ linux.patch/lemona/init.c 2008-12-18 16:32:36.000000000 +1100
@@ -0,0 +1,92 @@
+/*
+** This file is part of Lemona.
@@ -1445,7 +1497,7 @@
+module_exit(lemona_exit);
diff -uNr linux.vanilla/lemona/Kconfig linux.patch/lemona/Kconfig
--- linux.vanilla/lemona/Kconfig 1970-01-01 10:00:00.000000000 +1000
-+++ linux.patch/lemona/Kconfig 2008-12-08 13:40:16.000000000 +1100
++++ linux.patch/lemona/Kconfig 2008-12-18 16:32:36.000000000 +1100
@@ -0,0 +1,64 @@
+#
+# Lemona Configuration
@@ -1513,8 +1565,8 @@
+endmenu
diff -uNr linux.vanilla/lemona/lemona_blades.h
linux.patch/lemona/lemona_blades.h
--- linux.vanilla/lemona/lemona_blades.h 1970-01-01 10:00:00.000000000
+1000
-+++ linux.patch/lemona/lemona_blades.h 2008-12-08 13:40:16.000000000 +1100
-@@ -0,0 +1,59 @@
++++ linux.patch/lemona/lemona_blades.h 2008-12-18 16:32:36.000000000 +1100
+@@ -0,0 +1,66 @@
+/*
+** This file is part of Lemona.
+** Copyright (C) 2008 Kenfe-Micka�l Laventure
@@ -1573,10 +1625,17 @@
+ int isExt, int idx, int off,
+ void __user *str, void *unused);
+
++/*
++ * from blades/iovec.c
++ */
++int lemona_blade_iovec(struct lemona_zest *zest,
++ int isExt, int idx, int off,
++ void *iov, void *vlen);
++
+#endif
diff -uNr linux.vanilla/lemona/lemona.h linux.patch/lemona/lemona.h
--- linux.vanilla/lemona/lemona.h 1970-01-01 10:00:00.000000000 +1000
-+++ linux.patch/lemona/lemona.h 2008-12-08 13:40:16.000000000 +1100
++++ linux.patch/lemona/lemona.h 2008-12-18 16:32:36.000000000 +1100
@@ -0,0 +1,143 @@
+/*
+** This file is part of Lemona.
@@ -1723,7 +1782,7 @@
+#endif
diff -uNr linux.vanilla/lemona/lemona_net.h linux.patch/lemona/lemona_net.h
--- linux.vanilla/lemona/lemona_net.h 1970-01-01 10:00:00.000000000 +1000
-+++ linux.patch/lemona/lemona_net.h 2008-12-08 13:40:16.000000000 +1100
++++ linux.patch/lemona/lemona_net.h 2008-12-18 16:32:36.000000000 +1100
@@ -0,0 +1,67 @@
+/*
+** This file is part of Lemona.
@@ -1794,7 +1853,7 @@
+#endif
diff -uNr linux.vanilla/lemona/lemona_patch.h
linux.patch/lemona/lemona_patch.h
--- linux.vanilla/lemona/lemona_patch.h 1970-01-01 10:00:00.000000000 +1000
-+++ linux.patch/lemona/lemona_patch.h 2008-12-08 13:40:16.000000000 +1100
++++ linux.patch/lemona/lemona_patch.h 2008-12-18 16:32:36.000000000 +1100
@@ -0,0 +1,96 @@
+/*
+** This file is part of Lemona.
@@ -1894,7 +1953,7 @@
+#endif /* _LEMONA_PATCH_H_ */
diff -uNr linux.vanilla/lemona/lemona_relay.h
linux.patch/lemona/lemona_relay.h
--- linux.vanilla/lemona/lemona_relay.h 1970-01-01 10:00:00.000000000 +1000
-+++ linux.patch/lemona/lemona_relay.h 2008-12-08 13:40:16.000000000 +1100
++++ linux.patch/lemona/lemona_relay.h 2008-12-18 16:32:36.000000000 +1100
@@ -0,0 +1,99 @@
+/*
+** This file is part of Lemona.
@@ -1997,8 +2056,8 @@
+#endif
diff -uNr linux.vanilla/lemona/logging.c linux.patch/lemona/logging.c
--- linux.vanilla/lemona/logging.c 1970-01-01 10:00:00.000000000 +1000
-+++ linux.patch/lemona/logging.c 2008-12-08 13:40:16.000000000 +1100
-@@ -0,0 +1,366 @@
++++ linux.patch/lemona/logging.c 2008-12-18 16:32:36.000000000 +1100
+@@ -0,0 +1,369 @@
+/*
+** This file is part of Lemona.
+** Copyright (C) 2008 Kenfe-Micka�l Laventure
@@ -2052,6 +2111,7 @@
+ int j = 0;
+ int tmp = 0;
+ int size = 0;
++ int argnr = 0;
+ int bladesnr;
+ const struct __lemona_mixer_handler *handlers;
+ void *arg1, *arg2;
@@ -2061,11 +2121,13 @@
+
+ if (in == true)
+ {
++ argnr = mixer->in.argnr;
+ handlers = mixer->in.handlers;
+ bladesnr = mixer->in.argnr + mixer->in.extnr;
+ }
+ else
+ {
++ argnr = mixer->out.argnr;
+ handlers = mixer->out.handlers;
+ bladesnr = mixer->out.argnr + mixer->out.extnr;
+ }
@@ -2084,10 +2146,10 @@
+ if (handlers[i].dual == true)
+ {
+ arg2 = va_arg(ap, void*);
-+ tmp = handlers[i].blade(NULL, false, i, 0, arg1, arg2);
++ tmp = handlers[i].blade(NULL, i > argnr, -1, 0, arg1, arg2);
+ }
+ else
-+ tmp = handlers[i].blade(NULL, false, i, 0, arg1, NULL);
++ tmp = handlers[i].blade(NULL, i > argnr, -1, 0, arg1, NULL);
+ if (tmp < 0)
+ {
+ lemona_printk("lemona_zest_get_size: "
@@ -2177,10 +2239,10 @@
+ if (handlers[i].dual == true)
+ {
+ arg2 = va_arg(ap, void*);
-+ ret = handlers[i].blade(z, false, i, off, arg1, arg2);
++ ret = handlers[i].blade(z, false, j, off, arg1, arg2);
+ }
+ else
-+ ret = handlers[i].blade(z, false, i, off, arg1, NULL);
++ ret = handlers[i].blade(z, false, j, off, arg1, NULL);
+ if (ret < 0)
+ {
+ lemona_printk("args (syscal %i) in: %i blade %i returned -1\n",
@@ -2203,10 +2265,10 @@
+ if (handlers[i].dual == true)
+ {
+ arg2 = va_arg(ap, void*);
-+ ret = handlers[i].blade(z, true, i, off, arg1, arg2);
++ ret = handlers[i].blade(z, true, j, off, arg1, arg2);
+ }
+ else
-+ ret = handlers[i].blade(z, true, i, off, arg1, NULL);
++ ret = handlers[i].blade(z, true, j, off, arg1, NULL);
+ if (ret < 0)
+ {
+ lemona_printk("exts (syscal %i) in: %i blade %i returned %i\n",
@@ -2367,7 +2429,7 @@
+}
diff -uNr linux.vanilla/lemona/Makefile linux.patch/lemona/Makefile
--- linux.vanilla/lemona/Makefile 1970-01-01 10:00:00.000000000 +1000
-+++ linux.patch/lemona/Makefile 2008-12-08 13:40:16.000000000 +1100
++++ linux.patch/lemona/Makefile 2008-12-18 16:32:36.000000000 +1100
@@ -0,0 +1,78 @@
+##
+## This file is part of Lemona.
@@ -2449,7 +2511,7 @@
+endif
diff -uNr linux.vanilla/lemona/MIT.LICENSE linux.patch/lemona/MIT.LICENSE
--- linux.vanilla/lemona/MIT.LICENSE 1970-01-01 10:00:00.000000000 +1000
-+++ linux.patch/lemona/MIT.LICENSE 2008-12-08 13:40:16.000000000 +1100
++++ linux.patch/lemona/MIT.LICENSE 2008-12-18 16:32:36.000000000 +1100
@@ -0,0 +1,19 @@
+Copyright (c) 2008 Kenfe-Micka�l Laventure, Laurent Malvert
+
@@ -2472,8 +2534,8 @@
+THE SOFTWARE.
diff -uNr linux.vanilla/lemona/mixers.c linux.patch/lemona/mixers.c
--- linux.vanilla/lemona/mixers.c 1970-01-01 10:00:00.000000000 +1000
-+++ linux.patch/lemona/mixers.c 2008-12-08 13:40:16.000000000 +1100
-@@ -0,0 +1,5711 @@
++++ linux.patch/lemona/mixers.c 2008-12-18 16:32:36.000000000 +1100
+@@ -0,0 +1,5713 @@
+/*
+** This file is part of Lemona.
+** Copyright (C) 2008 Kenfe-Micka�l Laventure, Laurent Malvert
@@ -4911,7 +4973,7 @@
+ .handlers = {
+ /* fd */
+ { .dual = false , .blade = lemona_blade_integer },
-+ /* offset_hight */
++ /* offset_high */
+ { .dual = false , .blade = lemona_blade_long },
+ /* offset_low */
+ { .dual = false , .blade = lemona_blade_long },
@@ -5005,34 +5067,36 @@
+ {
+ .sysnr = __NR_readv,
+ .in = {
-+ .argnr = -1,
-+ .extnr = -1,
++ .argnr = 1,
++ .extnr = 0,
+ .handlers = {
-+ { .dual = true, .blade = NULL },
++ { .dual = false , .blade = lemona_blade_long },
+ }
+ },
+ .out = {
-+ .argnr = -1,
-+ .extnr = -1,
++ .argnr = 3,
++ .extnr = 0,
+ .handlers = {
-+ { .dual = false, .blade = NULL },
++ { .dual = false , .blade = lemona_blade_integer },
++ { .dual = true , .blade = lemona_blade_iovec },
+ },
+ }
+ },
+ {
+ .sysnr = __NR_writev,
+ .in = {
-+ .argnr = -1,
-+ .extnr = -1,
++ .argnr = 3,
++ .extnr = 0,
+ .handlers = {
-+ { .dual = true, .blade = NULL },
++ { .dual = false , .blade = lemona_blade_long },
++ { .dual = true , .blade = lemona_blade_iovec },
+ }
+ },
+ .out = {
-+ .argnr = -1,
-+ .extnr = -1,
++ .argnr = 1,
++ .extnr = 0,
+ .handlers = {
-+ { .dual = false, .blade = NULL },
++ { .dual = false , .blade = lemona_blade_integer },
+ },
+ }
+ },
@@ -8187,7 +8251,7 @@
+
diff -uNr linux.vanilla/lemona/net.c linux.patch/lemona/net.c
--- linux.vanilla/lemona/net.c 1970-01-01 10:00:00.000000000 +1000
-+++ linux.patch/lemona/net.c 2008-12-08 13:40:16.000000000 +1100
++++ linux.patch/lemona/net.c 2008-12-18 16:32:36.000000000 +1100
@@ -0,0 +1,214 @@
+/*
+** This file is part of Lemona.
@@ -8405,7 +8469,7 @@
+}
diff -uNr linux.vanilla/lemona/README linux.patch/lemona/README
--- linux.vanilla/lemona/README 1970-01-01 10:00:00.000000000 +1000
-+++ linux.patch/lemona/README 2008-12-08 13:40:16.000000000 +1100
++++ linux.patch/lemona/README 2008-12-18 16:32:36.000000000 +1100
@@ -0,0 +1,132 @@
+Lemona Good To Know Stuff
+================================================
@@ -8541,7 +8605,7 @@
+ target remote /dev/pts/7
diff -uNr linux.vanilla/lemona/relay.c linux.patch/lemona/relay.c
--- linux.vanilla/lemona/relay.c 1970-01-01 10:00:00.000000000 +1000
-+++ linux.patch/lemona/relay.c 2008-12-08 13:40:16.000000000 +1100
++++ linux.patch/lemona/relay.c 2008-12-18 16:32:36.000000000 +1100
@@ -0,0 +1,161 @@
+/*
+** This file is part of Lemona.

Modified: trunk/patchs/patch-2.6.26.3.partial
==============================================================================
--- trunk/patchs/patch-2.6.26.3.partial (original)
+++ trunk/patchs/patch-2.6.26.3.partial Wed Dec 17 21:56:26 2008
@@ -29,7 +29,7 @@
/*
diff -uNr linux.vanilla/fs/namei.c linux.patch/fs/namei.c
--- linux.vanilla/fs/namei.c 2008-09-27 17:26:10.000000000 +1000
-+++ linux.patch/fs/namei.c 2008-12-08 13:30:26.000000000 +1100
++++ linux.patch/fs/namei.c 2008-12-18 16:33:47.000000000 +1100
@@ -34,6 +34,9 @@
#include <asm/namei.h>
#include <asm/uaccess.h>
@@ -260,7 +260,7 @@

diff -uNr linux.vanilla/fs/open.c linux.patch/fs/open.c
--- linux.vanilla/fs/open.c 2008-09-27 17:26:11.000000000 +1000
-+++ linux.patch/fs/open.c 2008-12-08 13:30:20.000000000 +1100
++++ linux.patch/fs/open.c 2008-12-18 16:33:38.000000000 +1100
@@ -30,6 +30,8 @@
#include <linux/audit.h>
#include <linux/falloc.h>
@@ -347,7 +347,7 @@
EXPORT_SYMBOL(sys_close);
diff -uNr linux.vanilla/fs/read_write.c linux.patch/fs/read_write.c
--- linux.vanilla/fs/read_write.c 2008-09-27 17:26:11.000000000 +1000
-+++ linux.patch/fs/read_write.c 2008-12-08 13:30:11.000000000 +1100
++++ linux.patch/fs/read_write.c 2008-12-18 16:33:27.000000000 +1100
@@ -21,6 +21,9 @@
#include <asm/uaccess.h>
#include <asm/unistd.h>
@@ -382,7 +382,7 @@
bad:
+ lemona_block_start {
+ if (lemona_file == false)
-+ lemona_log_out(__NR_lseek, false, 1, 0, &retval);
++ lemona_log_out(__NR_lseek, 1, 0, &retval);
+ } lemona_block_end;
return retval;
}
@@ -445,7 +445,7 @@

+ lemona_block_start {
+ if (lemona_file == false)
-+ lemona_log_out(__NR_read, false, 2, 0, buf, &ret);
++ lemona_log_out(__NR_read, 2, 0, buf, &ret);
+ } lemona_block_end;
return ret;
}
@@ -508,7 +508,7 @@

+ lemona_block_start {
+ if (lemona_file == false)
-+ lemona_log_out(__NR_pread64, false, 2, 0, buf, &ret);
++ lemona_log_out(__NR_pread64, 2, 0, buf, &ret);
+ } lemona_block_end;
return ret;
}
@@ -544,6 +544,59 @@

+ lemona_block_start {
+ lemona_log_out(__NR_pwrite64, 1, 0, &ret);
++ } lemona_block_end;
+ return ret;
+ }
+
+@@ -659,8 +734,18 @@
+ struct file *file;
+ ssize_t ret = -EBADF;
+ int fput_needed;
++#if defined(LEMONA)
++ bool lemona_file = false;
++#endif
+
+ file = fget_light(fd, &fput_needed);
++
++ lemona_block_start {
++ if (file == NULL
++ || !(lemona_file = lemona_relay_is_ours(file->f_dentry)))
++ lemona_log_in(__NR_readv, 1, 0, &fd);
++ } lemona_block_end;
++
+ if (file) {
+ loff_t pos = file_pos_read(file);
+ ret = vfs_readv(file, vec, vlen, &pos);
+@@ -671,6 +756,11 @@
+ if (ret > 0)
+ add_rchar(current, ret);
+ inc_syscr(current);
++
++ lemona_block_start {
++ if (lemona_file == false)
++ lemona_log_out(__NR_readv, 3, 0, &ret, vec, vlen);
++ } lemona_block_end;
+ return ret;
+ }
+
+@@ -681,6 +771,10 @@
+ ssize_t ret = -EBADF;
+ int fput_needed;
+
++ lemona_block_start {
++ lemona_log_in(__NR_writev, 3, 0, &fd, vec, &vlen);
++ } lemona_block_end;
++
+ file = fget_light(fd, &fput_needed);
+ if (file) {
+ loff_t pos = file_pos_read(file);
+@@ -692,6 +786,10 @@
+ if (ret > 0)
+ add_wchar(current, ret);
+ inc_syscw(current);
++
++ lemona_block_start {
++ lemona_log_out(__NR_writev, 1, 0, &ret);
+ } lemona_block_end;
return ret;
}

Modified: trunk/tools/picker/blades/console/__init__.py
==============================================================================
--- trunk/tools/picker/blades/console/__init__.py (original)
+++ trunk/tools/picker/blades/console/__init__.py Wed Dec 17 21:56:26 2008
@@ -71,13 +71,15 @@
def PrintBuffer(header, buf, buflen):
print "%s" % header.center(80)
print "-" * 80
- off = 0
- #avoid uneeded \n
- if buf[-1] == "\n":
- buf = buf[:buflen - 1]
- while off < buflen:
- print " %017x | %s " % (off, buf[off:off+58])
- off += 58
+ offTot = 0
+ bufs = buf.replace("\t", " ").split("\n")
+ for b in bufs:
+ off = 0
+ blen = len(b)
+ while off < blen:
+ print " %017x | %s " % (offTot + off, b[off:off+58])
+ off += 58
+ offTot += blen
print "-" * 80

def Process(opts, zest):

Added: trunk/tools/picker/blades/console/_llseek.py
==============================================================================
--- (empty file)
+++ trunk/tools/picker/blades/console/_llseek.py Wed Dec 17 21:56:26 2008
@@ -0,0 +1,58 @@
+# -*- coding: utf-8 -*-
+##
+## This file is part of Lemona.
+## Copyright (C) 2008 Kenfe-Mickaël Laventure
+##
+## The contents of this file are subject to the terms of either the
+## GNU General Public License Version 2 ("GPL") or the MIT License
+## (collectively, the "License"). You may not use this file except in
+## compliance with the License. You can obtain a copy of the License
+## at http://www.opensource.org/licenses/gpl-2.0.php and
+## http://www.opensource.org/licenses/mit-license.php or GPL.LICENSE
+## and MIT.LICENSE. See the License for the specific language
+## governing permissions and limitations under the License.
+##
+
+from struct import unpack_from
+from blades import console
+
+sysnr = { "2.6.26.3" : 140 }
+
+sysname = "__NR__llseek"
+
+def ProcessIn(z):
+ # some sanity check
+ if z.argnr != 4 or z.extnr != 0:
+ raise NameError("Invalid '%s' Zest (In)" % sysname, z)
+ #fd, offset & whence
+ print " %s | %s | %s | %s " % ("FD".center(17), "OFFSET
HIGH".center(17),
+ "OFFSET
LOW".center(17), "WHENCE".center(17))
+ print "-" * 80
+ fd = unpack_from("i", z.args[0])[0]
+ offh = unpack_from("i", z.args[1])[0]
+ offl = unpack_from("i", z.args[2])[0]
+ wh = unpack_from("i", z.args[3])[0]
+ if wh == 0:
+ wh = "SEEK_SET"
+ elif wh == 1:
+ wh = "SEEK_CUR"
+ else:
+ wh = "SEEK_END"
+ print " %s | %s | %s | %s " % (str(fd).center(17),
str(offh).center(17),
+ str(offl).center(17), wh.center(17))
+ print "-" * 80
+
+def ProcessOut(z):
+ # some sanity check
+ if z.argnr != 1 or z.extnr != 0:
+ print z
+ raise NameError("Invalid '%s' Zest (Out)" % sysname, z)
+ ret = unpack_from("q", z.args[0])[0]
+ print " %s | %s " % ("RETURNED".center(17), str(ret).center(58))
+ print "-" * 80
+
+def Process(zest):
+ if zest.inout == True:
+ ProcessIn(zest)
+ else:
+ ProcessOut(zest)

Modified: trunk/tools/picker/blades/console/close.py
==============================================================================
--- trunk/tools/picker/blades/console/close.py (original)
+++ trunk/tools/picker/blades/console/close.py Wed Dec 17 21:56:26 2008
@@ -22,14 +22,14 @@

def ProcessDo(z, hdr):
# some sanity check
- if z.argnr != 2 or z.extnr != 0:
- raise NameError("Invalid '%s' Zest (In)" % sysname, zest)
+ if z.argnr != 1 or z.extnr != 0:
+ raise NameError("Invalid '%s' Zest (In)" % sysname, z)
val = unpack_from("i", z.args[0])[0]
print " %s | %s " % (hdr.center(17), str(val).center(38))
print "-" * 80

def Process(zest):
if zest.inout == True:
- ProcessIn(zest, "FD")
+ ProcessDo(zest, "FD")
else:
- ProcessOut(zest, "RETURNED")
+ ProcessDo(zest, "RETURNED")

Modified: trunk/tools/picker/blades/console/lseek.py
==============================================================================
--- trunk/tools/picker/blades/console/lseek.py (original)
+++ trunk/tools/picker/blades/console/lseek.py Wed Dec 17 21:56:26 2008
@@ -23,7 +23,7 @@
def ProcessIn(z):
# some sanity check
if z.argnr != 3 or z.extnr != 0:
- raise NameError("Invalid '%s' Zest (In)" % sysname, zest)
+ raise NameError("Invalid '%s' Zest (In)" % sysname, z)
#fd, offset & whence
print " %s | %s | %s " % ("FD".center(24), "OFFSET".center(24),
"WHENCE".center(24))
@@ -37,14 +37,15 @@
wh = "SEEK_CUR"
else:
wh = "SEEK_END"
- print " %s | %s | %s" % (str(fd).center(37), str(off).center(37))
+ print " %s | %s | %s " % (str(fd).center(24), str(off).center(24),
+ wh.center(24))
print "-" * 80

def ProcessOut(z):
# some sanity check
if z.argnr != 1 or z.extnr != 0:
print z
- raise NameError("Invalid '%s' Zest (Out)" % sysname, zest)
+ raise NameError("Invalid '%s' Zest (Out)" % sysname, z)
ret = unpack_from("i", z.args[0])[0]
print " %s | %s " % ("RETURNED".center(17), str(ret).center(58))
print "-" * 80

Modified: trunk/tools/picker/blades/console/open.py
==============================================================================
--- trunk/tools/picker/blades/console/open.py (original)
+++ trunk/tools/picker/blades/console/open.py Wed Dec 17 21:56:26 2008
@@ -22,9 +22,10 @@

def ProcessIn(z):
# some sanity check
- if z.argnr != 2 or z.extnr != 0:
- raise NameError("Invalid '%s' Zest (In)" % sysname, zest)
+ if z.argnr != 3 or z.extnr != 0:
+ raise NameError("Invalid '%s' Zest (In)" % sysname, z)
#Filename as passed by user
+ print z.argsz[0]
console.PrintString("FILENAME", z.args[0], z.argsz[0])
#Flags & mode
print " %s | %s " % ("FLAGS".center(37), "MODE".center(37))
@@ -36,18 +37,18 @@

def ProcessOut(z):
# some sanity check
- if z.argnr != 2 or z.extnr != 0:
+ if z.argnr != 1 or z.extnr != 1:
print z
- raise NameError("Invalid '%s' Zest (Out)" % sysname, zest)
+ raise NameError("Invalid '%s' Zest (Out)" % sysname, z)
ret = unpack_from("i", z.args[0])[0]
print " %s | %s " % ("RETURNED".center(17), str(ret).center(58))
print "-" * 80
#Path as resolved by kernel
if ret >= 0:
- str = z.args[1].split("/")
- str.reverse()
- str = "/".join(str)
- console.PrintString("RESOLVED PATH", str, z.argsz[1])
+ pth = z.exts[0].split("/")
+ pth.reverse()
+ pth = "/".join(pth)
+ console.PrintString("RESOLVED PATH", pth, z.extsz[0])

def Process(zest):
if zest.inout == True:

Added: trunk/tools/picker/blades/console/openat.py
==============================================================================
--- (empty file)
+++ trunk/tools/picker/blades/console/openat.py Wed Dec 17 21:56:26 2008
@@ -0,0 +1,57 @@
+# -*- coding: utf-8 -*-
+##
+## This file is part of Lemona.
+## Copyright (C) 2008 Kenfe-Mickaël Laventure
+##
+## The contents of this file are subject to the terms of either the
+## GNU General Public License Version 2 ("GPL") or the MIT License
+## (collectively, the "License"). You may not use this file except in
+## compliance with the License. You can obtain a copy of the License
+## at http://www.opensource.org/licenses/gpl-2.0.php and
+## http://www.opensource.org/licenses/mit-license.php or GPL.LICENSE
+## and MIT.LICENSE. See the License for the specific language
+## governing permissions and limitations under the License.
+##
+
+from struct import unpack_from
+from blades import console
+
+sysnr = { "2.6.26.3" : 295 }
+
+sysname = "__NR_openat"
+
+def ProcessIn(z):
+ # some sanity check
+ if z.argnr != 4 or z.extnr != 0:
+ raise NameError("Invalid '%s' Zest (In)" % sysname, z)
+ #Filename as passed by user
+ console.PrintString("FILENAME", z.args[1], z.argsz[1])
+ #Flags & mode
+ print " %s | %s | %s " % ("DIRFD".center(22),
+ "FLAGS".center(22), "MODE".center(22))
+ print "-" * 80
+ flags = unpack_from("i", z.args[2])[0]
+ mode = unpack_from("i", z.args[3])[0]
+ print " %s | %s " % (str(flags).center(37), str(mode).center(37))
+ print "-" * 80
+
+def ProcessOut(z):
+ # some sanity check
+ if z.argnr != 1 or z.extnr != 1:
+ print z
+ raise NameError("Invalid '%s' Zest (Out)" % sysname, z)
+ ret = unpack_from("i", z.args[0])[0]
+ print " %s | %s " % ("RETURNED".center(17), str(ret).center(58))
+ print "-" * 80
+ #Path as resolved by kernel
+ if ret >= 0:
+ str = z.args[1].split("/")
+ str.reverse()
+ str = "/".join(str)
+ console.PrintString("RESOLVED PATH", str, z.argsz[1])
+
+def Process(zest):
+ if zest.inout == True:
+ ProcessIn(zest)
+ else:
+ ProcessOut(zest)
Reply all
Reply to author
Forward
0 new messages