aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sysfs.h
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2007-08-24 19:11:54 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-10-16 12:24:41 -0400
commitae87221d3ce49d9de1e43756da834fd0bf05a2ad (patch)
treef96792656b00e95c307f3f37369c98a85ce38207 /include/linux/sysfs.h
parente94320939f44e0cbaccc3f259a5778abced4949c (diff)
sysfs: crash debugging
Print the name of the last-accessed sysfs file when we oops, to help track down oopses which occur in sysfs store/read handlers. Because these oopses tend to not leave any trace of the offending code in the stack traces. Cc: Kay Sievers <kay.sievers@vrfy.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/sysfs.h')
-rw-r--r--include/linux/sysfs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 37fa24152bd8..8ec406afb3eb 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -119,6 +119,8 @@ void sysfs_remove_file_from_group(struct kobject *kobj,
119 119
120void sysfs_notify(struct kobject *kobj, char *dir, char *attr); 120void sysfs_notify(struct kobject *kobj, char *dir, char *attr);
121 121
122void sysfs_printk_last_file(void);
123
122extern int __must_check sysfs_init(void); 124extern int __must_check sysfs_init(void);
123 125
124#else /* CONFIG_SYSFS */ 126#else /* CONFIG_SYSFS */
@@ -231,6 +233,10 @@ static inline int __must_check sysfs_init(void)
231 return 0; 233 return 0;
232} 234}
233 235
236static inline void sysfs_printk_last_file(void)
237{
238}
239
234#endif /* CONFIG_SYSFS */ 240#endif /* CONFIG_SYSFS */
235 241
236#endif /* _SYSFS_H_ */ 242#endif /* _SYSFS_H_ */