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;
tsk = current;
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);
cnt = snprintf(buf,size,"ppid=%d\n",tsk->parent->pid);
__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;
/* FIXME the MAGIC word is not escaped it could emerge as argument */
cnt = snprintf(buf,size,"DONE=1\n");
AHA_PRINTK("__aha_set_done_tag\n");
__aha_os_write_file_ck(fd,buf,size,cnt);
}
@ -69,7 +71,9 @@ inline void __aha_set_type_tag(int fd, char* buf,int size,int tag)
int cnt; /* May break inline but makes code more readable */
/* FIXME Espacing is not done */
cnt = snprintf(buf,size,"type=%d\n",tag);
__aha_os_write_file_ck(fd,buf,size,cnt);
AHA_PRINTK("__aha_set_type_tag\n");
__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;
int cnt;
AHA_PRINTK("__aha_dump_str_array\n");
for (;;) {
if (get_user(a,argv))
break;
if (!a)
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);
__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.c = 1;
cnt = 0;
AHA_PRINTK("aha_record_sys_clone\n");
aha_create_filename((char*)&filename,filename__size);
snprintf((char*)&buf, buf__size,"out/%s",filename);
fd = os_open_file(buf,flg,mode);