Added temporary tracing messages in aha.c

This commit is contained in:
Gerard Wagener 2010-10-11 18:12:10 +02:00
parent d54122dd6c
commit 4ec88462fc

View file

@ -48,6 +48,7 @@ inline void __aha_dump_pid_ppids(int fd, char* buf, int size)
int cnt; int cnt;
tsk = current; tsk = current;
cnt = snprintf(buf,size,"pid=%d\n",tsk->pid); cnt = snprintf(buf,size,"pid=%d\n",tsk->pid);
AHA_PRINTK("__aha_dump_pid_ppids\n");
__aha_os_write_file_ck(fd,buf,size,cnt); __aha_os_write_file_ck(fd,buf,size,cnt);
cnt = snprintf(buf,size,"ppid=%d\n",tsk->parent->pid); cnt = snprintf(buf,size,"ppid=%d\n",tsk->parent->pid);
__aha_os_write_file_ck(fd,buf,size,cnt); __aha_os_write_file_ck(fd,buf,size,cnt);
@ -60,6 +61,7 @@ inline void __aha_set_done_tag(int fd, char* buf,int size)
int cnt; int cnt;
/* FIXME the MAGIC word is not escaped it could emerge as argument */ /* FIXME the MAGIC word is not escaped it could emerge as argument */
cnt = snprintf(buf,size,"DONE=1\n"); cnt = snprintf(buf,size,"DONE=1\n");
AHA_PRINTK("__aha_set_done_tag\n");
__aha_os_write_file_ck(fd,buf,size,cnt); __aha_os_write_file_ck(fd,buf,size,cnt);
} }
@ -69,8 +71,10 @@ inline void __aha_set_type_tag(int fd, char* buf,int size,int tag)
int cnt; /* May break inline but makes code more readable */ int cnt; /* May break inline but makes code more readable */
/* FIXME Espacing is not done */ /* FIXME Espacing is not done */
cnt = snprintf(buf,size,"type=%d\n",tag); cnt = snprintf(buf,size,"type=%d\n",tag);
AHA_PRINTK("__aha_set_type_tag\n");
__aha_os_write_file_ck(fd,buf,size,cnt); __aha_os_write_file_ck(fd,buf,size,cnt);
} }
@ -78,12 +82,13 @@ inline void __aha_dump_str_array(int fd, char** argv,char*id, char* p, char*q)
{ {
char* a; char* a;
int cnt; int cnt;
AHA_PRINTK("__aha_dump_str_array\n");
for (;;) { for (;;) {
if (get_user(a,argv)) if (get_user(a,argv))
break; break;
if (!a) if (!a)
break; break;
if (strncpy_from_user(p,a, MAX_DUMP_BUF) > 0) { if (strncpy_from_user(p,a, (MAX_DUMP_BUF / 2) - 4 ) > 0) {
cnt=snprintf(q,MAX_DUMP_BUF,"%s=%s\n",id,p); cnt=snprintf(q,MAX_DUMP_BUF,"%s=%s\n",id,p);
__aha_os_write_file_ck(fd,q,MAX_DUMP_BUF,cnt); __aha_os_write_file_ck(fd,q,MAX_DUMP_BUF,cnt);
} }
@ -214,7 +219,7 @@ void aha_record_sys_clone(int pid, int ppid)
flg.w = 1; flg.w = 1;
flg.c = 1; flg.c = 1;
cnt = 0; cnt = 0;
AHA_PRINTK("aha_record_sys_clone\n");
aha_create_filename((char*)&filename,filename__size); aha_create_filename((char*)&filename,filename__size);
snprintf((char*)&buf, buf__size,"out/%s",filename); snprintf((char*)&buf, buf__size,"out/%s",filename);
fd = os_open_file(buf,flg,mode); fd = os_open_file(buf,flg,mode);