PageRenderTime 22ms CodeModel.GetById 18ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/arch/um/kernel/syscall_user.c

https://bitbucket.org/evzijst/gittest
C | 48 lines | 27 code | 7 blank | 14 comment | 0 complexity | 7ed54d09a4b8144734a0fceceef86a50 MD5 | raw file
 1/* 
 2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
 3 * Licensed under the GPL
 4 */
 5
 6#include <stdlib.h>
 7#include <sys/time.h>
 8#include "kern_util.h"
 9#include "syscall_user.h"
10
11struct {
12	int syscall;
13	int pid;
14	long result;
15	struct timeval start;
16	struct timeval end;
17} syscall_record[1024];
18
19int record_syscall_start(int syscall)
20{
21	int max, index;
22
23	max = sizeof(syscall_record)/sizeof(syscall_record[0]);
24	index = next_syscall_index(max);
25
26	syscall_record[index].syscall = syscall;
27	syscall_record[index].pid = current_pid();
28	syscall_record[index].result = 0xdeadbeef;
29	gettimeofday(&syscall_record[index].start, NULL);
30	return(index);
31}
32
33void record_syscall_end(int index, long result)
34{
35	syscall_record[index].result = result;
36	gettimeofday(&syscall_record[index].end, NULL);
37}
38
39/*
40 * Overrides for Emacs so that we follow Linus's tabbing style.
41 * Emacs will notice this stuff at the end of the file and automatically
42 * adjust the settings for this buffer only.  This must remain at the end
43 * of the file.
44 * ---------------------------------------------------------------------------
45 * Local variables:
46 * c-file-style: "linux"
47 * End:
48 */