#include <string.h>
#if 0
-#define TRACE(x...) do{log(L_DEBUG, x);}while(0)
+#define TRACE(x...) do{msg(L_DEBUG, x);}while(0)
#else
#define TRACE(x...) do{}while(0)
#endif
if (!b)
die("Cannot create large-file");
- log(L_DEBUG, "Writing %d blocks of size %d", COUNT, BLOCK);
+ msg(L_DEBUG, "Writing %d blocks of size %d", COUNT, BLOCK);
for (i=0; i<COUNT; i++)
{
memset(block, i & 0xff, BLOCK);
if (!b)
die("Cannot create large-file");
#endif
- log(L_DEBUG, "Checking the file contents in %d tests", TESTS);
+ msg(L_DEBUG, "Checking the file contents in %d tests", TESTS);
for (i=0; i<TESTS; i++)
{
uns idx = random()%COUNT;
fflush(stdout);
}
}
- log(L_DEBUG, "Done");
+ msg(L_DEBUG, "Done");
bclose(b);
return 0;
log_init(argv[0]);
log_file("/proc/self/fd/1");
for (int i=1; i<argc; i++)
- log(L_INFO, argv[i]);
+ msg(L_INFO, argv[i]);
return 0;
}
{
if (fi->rpos < fi->rlen)
{
- log(L_INFO, "Read EOF");
+ msg(L_INFO, "Read EOF");
file_del(fi);
}
else
{
- log(L_INFO, "Read done");
+ msg(L_INFO, "Read done");
file_read(fi, rb, sizeof(rb));
}
}
static void derror(struct main_file *fi, int cause)
{
- log(L_INFO, "Error: %m !!! (cause %d)", cause);
+ msg(L_INFO, "Error: %m !!! (cause %d)", cause);
file_del(fi);
}
static void dwrite(struct main_file *fi UNUSED)
{
- log(L_INFO, "Write done");
+ msg(L_INFO, "Write done");
}
static int dhook(struct main_hook *ho UNUSED)
{
- log(L_INFO, "Hook called");
+ msg(L_INFO, "Hook called");
return 0;
}
static void dtimer(struct main_timer *tm)
{
- log(L_INFO, "Timer tick");
+ msg(L_INFO, "Timer tick");
timer_add(tm, main_now + 10000);
}
static void dentry(void)
{
- log(L_INFO, "*** SUBPROCESS START ***");
+ msg(L_INFO, "*** SUBPROCESS START ***");
sleep(2);
- log(L_INFO, "*** SUBPROCESS FINISH ***");
+ msg(L_INFO, "*** SUBPROCESS FINISH ***");
exit(0);
}
static void dexit(struct main_process *pr)
{
- log(L_INFO, "Subprocess %d exited with status %x", pr->pid, pr->status);
+ msg(L_INFO, "Subprocess %d exited with status %x", pr->pid, pr->status);
}
int
main_debug();
main_loop();
- log(L_INFO, "Finished.");
+ msg(L_INFO, "Finished.");
}
#endif
{
char msg[1024];
echo_command(msg, sizeof(msg), "/bin/echo", "datel", "strakapoud", NULL);
- log(L_INFO, "Running <%s>", msg);
+ msg(L_INFO, "Running <%s>", msg);
run_command("/bin/echo", "datel", "strakapoud", NULL);
return 0;
}
{
ucwlib_lock();
ucwlib_unlock();
- log(L_INFO, "tid=%d", ucwlib_thread_context()->thread_id);
+ msg(L_INFO, "tid=%d", ucwlib_thread_context()->thread_id);
return 0;
}
static void wt_init(struct worker_thread *t)
{
- log(L_INFO, "INIT %d", t->id);
+ msg(L_INFO, "INIT %d", t->id);
}
static void wt_cleanup(struct worker_thread *t)
{
- log(L_INFO, "CLEANUP %d", t->id);
+ msg(L_INFO, "CLEANUP %d", t->id);
}
struct w {
static void go(struct worker_thread *t, struct work *w)
{
- log(L_INFO, "GO %d: request %d (pri %d)", t->id, ((struct w *)w)->id, w->priority);
+ msg(L_INFO, "GO %d: request %d (pri %d)", t->id, ((struct w *)w)->id, w->priority);
usleep(1);
}
w->w.priority = (i < 250 ? i : 0);
w->id = i;
work_submit(&q, &w->w);
- log(L_INFO, "Submitted request %d (pri %d)", w->id, w->w.priority);
+ msg(L_INFO, "Submitted request %d (pri %d)", w->id, w->w.priority);
}
struct w *w;
while (w = (struct w *) work_wait(&q))
- log(L_INFO, "Finished request %d", w->id);
+ msg(L_INFO, "Finished request %d", w->id);
work_queue_cleanup(&q);
worker_pool_cleanup(&pool);