Duy Truong | 790f06d | 2013-02-13 16:38:12 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2009, The Linux Foundation. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | * |
| 12 | */ |
| 13 | #ifndef __ARCH_ARM_MACH_MSM_DEBUG_MM_H_ |
| 14 | #define __ARCH_ARM_MACH_MSM_DEBUG_MM_H_ |
| 15 | |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 16 | #include <linux/string.h> |
| 17 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 18 | /* The below macro removes the directory path name and retains only the |
| 19 | * file name to avoid long path names in log messages that comes as |
| 20 | * part of __FILE__ to compiler. |
| 21 | */ |
| 22 | #define __MM_FILE__ strrchr(__FILE__, '/') ? (strrchr(__FILE__, '/')+1) : \ |
| 23 | __FILE__ |
| 24 | |
| 25 | #define MM_DBG(fmt, args...) pr_debug("[%s] " fmt,\ |
| 26 | __func__, ##args) |
| 27 | |
| 28 | #define MM_INFO(fmt, args...) pr_info("[%s:%s] " fmt,\ |
| 29 | __MM_FILE__, __func__, ##args) |
| 30 | |
| 31 | #define MM_ERR(fmt, args...) pr_err("[%s:%s] " fmt,\ |
| 32 | __MM_FILE__, __func__, ##args) |
| 33 | #endif /* __ARCH_ARM_MACH_MSM_DEBUG_MM_H_ */ |