17 #include <linux/errno.h>
18 #include <linux/slab.h>
19 #include <linux/string.h>
40 static unsigned int num_counter_active(
struct gcov_info *info)
46 if (counter_active(info, i))
58 unsigned int active = num_counter_active(info);
61 for (i = 0; i <
active; i++) {
91 for (i = 0; i < num_counter_active(dest); i++) {
92 for (j = 0; j < dest->
counts[
i].num; j++) {
100 static size_t get_fn_size(
struct gcov_info *info)
104 size =
sizeof(
struct gcov_fn_info) + num_counter_active(info) *
105 sizeof(
unsigned int);
115 ((
char *) info->
functions + fn * get_fn_size(info));
131 active = num_counter_active(info);
150 for (i = 0; i <
active ; i++) {
157 if (!dup->
counts[i].values)
174 unsigned int active = num_counter_active(info);
177 for (i = 0; i <
active ; i++)
223 unsigned int function;
252 num_counter_active(info) *
sizeof(
struct type_info),
292 if (counter_active(iter->
info, i)) {
300 #define RECORD_FILE_MAGIC 0
301 #define RECORD_GCOV_VERSION 1
302 #define RECORD_TIME_STAMP 2
303 #define RECORD_FUNCTION_TAG 3
304 #define RECORD_FUNCTON_TAG_LEN 4
305 #define RECORD_FUNCTION_IDENT 5
306 #define RECORD_FUNCTION_CHECK 6
307 #define RECORD_COUNT_TAG 7
308 #define RECORD_COUNT_LEN 8
309 #define RECORD_COUNT 9
334 if (iter->
count < get_func(iter)->n_ctrs[iter->
type]) {
339 get_type(iter)->offset += iter->
count;
375 static int seq_write_gcov_u32(
struct seq_file *seq,
u32 v)
390 static int seq_write_gcov_u64(
struct seq_file *seq,
u64 v)
394 data[0] = (v & 0xffffffff
UL);
396 return seq_write(seq, data,
sizeof(data));
415 rc = seq_write_gcov_u32(seq, iter->
info->version);
418 rc = seq_write_gcov_u32(seq, iter->
info->stamp);
424 rc = seq_write_gcov_u32(seq, 2);
427 rc = seq_write_gcov_u32(seq, get_func(iter)->
ident);
430 rc = seq_write_gcov_u32(seq, get_func(iter)->
checksum);
433 rc = seq_write_gcov_u32(seq,
437 rc = seq_write_gcov_u32(seq,
438 get_func(iter)->n_ctrs[iter->
type] * 2);
441 rc = seq_write_gcov_u64(seq,