diff options
author | Alon Farchy <afarchy@nvidia.com> | 2011-07-05 17:12:29 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:48:21 -0800 |
commit | 14dcbce77792e27a94adb242650c50809435af30 (patch) | |
tree | f42e38a8aadc7e42df038173091eb017c3f4aa96 /include | |
parent | d11fc993854d3356b17a61057e6ae00fb1d8e264 (diff) |
tracelevel module: Prioritize trace events
This module lets subsystem authors prioritize ftrace events
by calling tracelevel_register(...). High priority traces
will be automatically enabled on boot. See tracelevel.h
for more details
Original-Change-Id: If03699e96c598bdcf93b9a9f73918ce7b0c750cb
Reviewed-on: http://git-master/r/40290
Reviewed-by: Alon Farchy <afarchy@nvidia.com>
Tested-by: Alon Farchy <afarchy@nvidia.com>
Reviewed-by: Daniel Willemsen <dwillemsen@nvidia.com>
Tested-by: Daniel Solomon <daniels@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
Rebase-Id: R49f59f81d61907f66fdf892130a1b4dc6575d40e
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/tracelevel.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/include/linux/tracelevel.h b/include/linux/tracelevel.h new file mode 100644 index 000000000000..ac3351c6ed85 --- /dev/null +++ b/include/linux/tracelevel.h @@ -0,0 +1,42 @@ +/* + * include/linux/tracelevel.c + * + * Copyright (c) 2011, NVIDIA CORPORATION. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#ifndef _TRACELEVEL_H +#define _TRACELEVEL_H + +/* tracelevel allows a subsystem author to add priorities to + * trace_events. For usage details, see tracelevel.txt. + */ + +#define TRACELEVEL_ERR 3 +#define TRACELEVEL_WARN 2 +#define TRACELEVEL_INFO 1 +#define TRACELEVEL_DEBUG 0 + +#define TRACELEVEL_MAX TRACELEVEL_ERR +#define TRACELEVEL_DEFAULT TRACELEVEL_ERR + +int __tracelevel_register(char *name, unsigned int level); +int tracelevel_set_level(int level); + +#define tracelevel_register(name, level) \ + __tracelevel_register(#name, level) + +#endif /* _TRACELEVEL_H */ |