2 * Copyright (C) 1993-1996 Bas Laarhoven,
3 * (C) 1996-1997 Claus-Justus Heine.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; see the file COPYING. If not, write to
17 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20 * $Source: /homes/cvs/ftape-stacked/ftape/lowlevel/ftape-tracing.c,v $
22 * $Date: 1997/10/05 19:18:27 $
24 * This file contains the reading code
25 * for the QIC-117 floppy-tape driver for Linux.
28 #include <linux/ftape.h>
29 #include "../lowlevel/ftape-tracing.h"
39 * 4 + more information
45 ft_trace_t ftape_tracing
= ft_t_info
; /* Default level: information and up */
46 int ftape_function_nest_level
;
51 static char spacing
[] = "* ";
53 void ftape_trace_call(const char *file
, const char *name
)
57 /* Since printk seems not to work with "%*s" format
58 * we'll use this work-around.
60 if (ftape_function_nest_level
< 0) {
61 printk(KERN_INFO
"function nest level (%d) < 0\n",
62 ftape_function_nest_level
);
63 ftape_function_nest_level
= 0;
65 if (ftape_function_nest_level
< sizeof(spacing
)) {
68 ftape_function_nest_level
);
72 printk(KERN_INFO
"[%03d]%s+%s (%s)\n",
73 (int) trace_id
++, indent
, file
, name
);
76 void ftape_trace_exit(const char *file
, const char *name
)
80 /* Since printk seems not to work with "%*s" format
81 * we'll use this work-around.
83 if (ftape_function_nest_level
< 0) {
84 printk(KERN_INFO
"function nest level (%d) < 0\n", ftape_function_nest_level
);
85 ftape_function_nest_level
= 0;
87 if (ftape_function_nest_level
< sizeof(spacing
)) {
90 ftape_function_nest_level
);
94 printk(KERN_INFO
"[%03d]%s-%s (%s)\n",
95 (int) trace_id
++, indent
, file
, name
);
98 void ftape_trace_log(const char *file
, const char *function
)
102 /* Since printk seems not to work with "%*s" format
103 * we'll use this work-around.
105 if (ftape_function_nest_level
< 0) {
106 printk(KERN_INFO
"function nest level (%d) < 0\n", ftape_function_nest_level
);
107 ftape_function_nest_level
= 0;
109 if (ftape_function_nest_level
< sizeof(spacing
)) {
111 sizeof(spacing
) - 1 -
112 ftape_function_nest_level
);
116 printk(KERN_INFO
"[%03d]%s%s (%s) - ",
117 (int) trace_id
++, indent
, file
, function
);