Linux 2.6.17.7
[linux/fpc-iii.git] / arch / um / kernel / syscall.c
blob1731d90e68507e1316cfa4a3c6c3d15f510f316b
1 /*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
6 #include "kern_util.h"
7 #include "syscall.h"
8 #include "os.h"
10 struct {
11 int syscall;
12 int pid;
13 long result;
14 unsigned long long start;
15 unsigned long long end;
16 } syscall_record[1024];
18 int record_syscall_start(int syscall)
20 int max, index;
22 max = sizeof(syscall_record)/sizeof(syscall_record[0]);
23 index = next_syscall_index(max);
25 syscall_record[index].syscall = syscall;
26 syscall_record[index].pid = current_pid();
27 syscall_record[index].result = 0xdeadbeef;
28 syscall_record[index].start = os_nsecs();
29 return(index);
32 void record_syscall_end(int index, long result)
34 syscall_record[index].result = result;
35 syscall_record[index].end = os_nsecs();