Linux Audio

Check our new training course

Loading...
v5.4
 1/* SPDX-License-Identifier: GPL-2.0 */
 2/*
 3 *  Profiling infrastructure declarations.
 4 *
 5 *  This file is based on gcc-internal definitions. Data structures are
 6 *  defined to be compatible with gcc counterparts. For a better
 7 *  understanding, refer to gcc source: gcc/gcov-io.h.
 8 *
 9 *    Copyright IBM Corp. 2009
10 *    Author(s): Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
11 *
12 *    Uses gcc-internal data definitions.
13 */
14
15#ifndef GCOV_H
16#define GCOV_H GCOV_H
17
18#include <linux/module.h>
19#include <linux/types.h>
20
21/*
22 * Profiling data types used for gcc 3.4 and above - these are defined by
23 * gcc and need to be kept as close to the original definition as possible to
24 * remain compatible.
25 */
26#define GCOV_DATA_MAGIC		((unsigned int) 0x67636461)
27#define GCOV_TAG_FUNCTION	((unsigned int) 0x01000000)
28#define GCOV_TAG_COUNTER_BASE	((unsigned int) 0x01a10000)
29#define GCOV_TAG_FOR_COUNTER(count)					\
30	(GCOV_TAG_COUNTER_BASE + ((unsigned int) (count) << 17))
31
32#if BITS_PER_LONG >= 64
33typedef long gcov_type;
34#else
35typedef long long gcov_type;
36#endif
37
38/* Opaque gcov_info. The gcov structures can change as for example in gcc 4.7 so
39 * we cannot use full definition here and they need to be placed in gcc specific
40 * implementation of gcov. This also means no direct access to the members in
41 * generic code and usage of the interface below.*/
42struct gcov_info;
43
44/* Interface to access gcov_info data  */
45const char *gcov_info_filename(struct gcov_info *info);
46unsigned int gcov_info_version(struct gcov_info *info);
47struct gcov_info *gcov_info_next(struct gcov_info *info);
48void gcov_info_link(struct gcov_info *info);
49void gcov_info_unlink(struct gcov_info *prev, struct gcov_info *info);
50bool gcov_info_within_module(struct gcov_info *info, struct module *mod);
51
52/* Base interface. */
53enum gcov_action {
54	GCOV_ADD,
55	GCOV_REMOVE,
56};
57
58void gcov_event(enum gcov_action action, struct gcov_info *info);
59void gcov_enable_events(void);
60
61/* Iterator control. */
62struct seq_file;
63struct gcov_iterator;
64
65struct gcov_iterator *gcov_iter_new(struct gcov_info *info);
66void gcov_iter_free(struct gcov_iterator *iter);
67void gcov_iter_start(struct gcov_iterator *iter);
68int gcov_iter_next(struct gcov_iterator *iter);
69int gcov_iter_write(struct gcov_iterator *iter, struct seq_file *seq);
70struct gcov_info *gcov_iter_get_info(struct gcov_iterator *iter);
71
72/* gcov_info control. */
73void gcov_info_reset(struct gcov_info *info);
74int gcov_info_is_compatible(struct gcov_info *info1, struct gcov_info *info2);
75void gcov_info_add(struct gcov_info *dest, struct gcov_info *source);
76struct gcov_info *gcov_info_dup(struct gcov_info *info);
77void gcov_info_free(struct gcov_info *info);
78
79struct gcov_link {
80	enum {
81		OBJ_TREE,
82		SRC_TREE,
83	} dir;
84	const char *ext;
85};
86extern const struct gcov_link gcov_link[];
87
88extern int gcov_events_enabled;
89extern struct mutex gcov_lock;
90
91#endif /* GCOV_H */
v4.10.11
 
 1/*
 2 *  Profiling infrastructure declarations.
 3 *
 4 *  This file is based on gcc-internal definitions. Data structures are
 5 *  defined to be compatible with gcc counterparts. For a better
 6 *  understanding, refer to gcc source: gcc/gcov-io.h.
 7 *
 8 *    Copyright IBM Corp. 2009
 9 *    Author(s): Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
10 *
11 *    Uses gcc-internal data definitions.
12 */
13
14#ifndef GCOV_H
15#define GCOV_H GCOV_H
16
 
17#include <linux/types.h>
18
19/*
20 * Profiling data types used for gcc 3.4 and above - these are defined by
21 * gcc and need to be kept as close to the original definition as possible to
22 * remain compatible.
23 */
24#define GCOV_DATA_MAGIC		((unsigned int) 0x67636461)
25#define GCOV_TAG_FUNCTION	((unsigned int) 0x01000000)
26#define GCOV_TAG_COUNTER_BASE	((unsigned int) 0x01a10000)
27#define GCOV_TAG_FOR_COUNTER(count)					\
28	(GCOV_TAG_COUNTER_BASE + ((unsigned int) (count) << 17))
29
30#if BITS_PER_LONG >= 64
31typedef long gcov_type;
32#else
33typedef long long gcov_type;
34#endif
35
36/* Opaque gcov_info. The gcov structures can change as for example in gcc 4.7 so
37 * we cannot use full definition here and they need to be placed in gcc specific
38 * implementation of gcov. This also means no direct access to the members in
39 * generic code and usage of the interface below.*/
40struct gcov_info;
41
42/* Interface to access gcov_info data  */
43const char *gcov_info_filename(struct gcov_info *info);
44unsigned int gcov_info_version(struct gcov_info *info);
45struct gcov_info *gcov_info_next(struct gcov_info *info);
46void gcov_info_link(struct gcov_info *info);
47void gcov_info_unlink(struct gcov_info *prev, struct gcov_info *info);
 
48
49/* Base interface. */
50enum gcov_action {
51	GCOV_ADD,
52	GCOV_REMOVE,
53};
54
55void gcov_event(enum gcov_action action, struct gcov_info *info);
56void gcov_enable_events(void);
57
58/* Iterator control. */
59struct seq_file;
60struct gcov_iterator;
61
62struct gcov_iterator *gcov_iter_new(struct gcov_info *info);
63void gcov_iter_free(struct gcov_iterator *iter);
64void gcov_iter_start(struct gcov_iterator *iter);
65int gcov_iter_next(struct gcov_iterator *iter);
66int gcov_iter_write(struct gcov_iterator *iter, struct seq_file *seq);
67struct gcov_info *gcov_iter_get_info(struct gcov_iterator *iter);
68
69/* gcov_info control. */
70void gcov_info_reset(struct gcov_info *info);
71int gcov_info_is_compatible(struct gcov_info *info1, struct gcov_info *info2);
72void gcov_info_add(struct gcov_info *dest, struct gcov_info *source);
73struct gcov_info *gcov_info_dup(struct gcov_info *info);
74void gcov_info_free(struct gcov_info *info);
75
76struct gcov_link {
77	enum {
78		OBJ_TREE,
79		SRC_TREE,
80	} dir;
81	const char *ext;
82};
83extern const struct gcov_link gcov_link[];
 
 
 
84
85#endif /* GCOV_H */