Lines Matching +full:1 +full:p1

27 #define true 1
44 FILTER_PID = 1<<1,
45 FILTER_TGID = 1<<2,
46 FILTER_COMM = 1<<3
49 CULL_PID = 1<<1,
50 CULL_TGID = 1<<2,
51 CULL_COMM = 1<<3,
52 CULL_STACKTRACE = 1<<4,
53 CULL_ALLOCATOR = 1<<5
56 ALLOCATOR_CMA = 1<<1,
57 ALLOCATOR_SLAB = 1<<2,
58 ALLOCATOR_VMALLOC = 1<<3,
59 ALLOCATOR_OTHERS = 1<<4
66 SORT_ASC = 1,
67 SORT_DESC = -1,
71 COMP_ALLOC = 1<<0,
72 COMP_PAGE_NUM = 1<<1,
73 COMP_PID = 1<<2,
74 COMP_STACK = 1<<3,
75 COMP_NUM = 1<<4,
76 COMP_TGID = 1<<5,
77 COMP_COMM = 1<<6
112 while (buf_end - curr > 1 && fgets(curr, buf_end - curr, fin)) { in read_block()
123 return -1; /* EOF or no space left in buf. */ in read_block()
126 static int compare_txt(const void *p1, const void *p2) in compare_txt() argument
128 const struct block_list *l1 = p1, *l2 = p2; in compare_txt()
133 static int compare_stacktrace(const void *p1, const void *p2) in compare_stacktrace() argument
135 const struct block_list *l1 = p1, *l2 = p2; in compare_stacktrace()
140 static int compare_num(const void *p1, const void *p2) in compare_num() argument
142 const struct block_list *l1 = p1, *l2 = p2; in compare_num()
147 static int compare_page_num(const void *p1, const void *p2) in compare_page_num() argument
149 const struct block_list *l1 = p1, *l2 = p2; in compare_page_num()
154 static int compare_pid(const void *p1, const void *p2) in compare_pid() argument
156 const struct block_list *l1 = p1, *l2 = p2; in compare_pid()
161 static int compare_tgid(const void *p1, const void *p2) in compare_tgid() argument
163 const struct block_list *l1 = p1, *l2 = p2; in compare_tgid()
168 static int compare_allocator(const void *p1, const void *p2) in compare_allocator() argument
170 const struct block_list *l1 = p1, *l2 = p2; in compare_allocator()
175 static int compare_comm(const void *p1, const void *p2) in compare_comm() argument
177 const struct block_list *l1 = p1, *l2 = p2; in compare_comm()
182 static int compare_ts(const void *p1, const void *p2) in compare_ts() argument
184 const struct block_list *l1 = p1, *l2 = p2; in compare_ts()
186 return l1->ts_nsec < l2->ts_nsec ? -1 : 1; in compare_ts()
189 static int compare_cull_condition(const void *p1, const void *p2) in compare_cull_condition() argument
192 return compare_txt(p1, p2); in compare_cull_condition()
193 if ((cull & CULL_STACKTRACE) && compare_stacktrace(p1, p2)) in compare_cull_condition()
194 return compare_stacktrace(p1, p2); in compare_cull_condition()
195 if ((cull & CULL_PID) && compare_pid(p1, p2)) in compare_cull_condition()
196 return compare_pid(p1, p2); in compare_cull_condition()
197 if ((cull & CULL_TGID) && compare_tgid(p1, p2)) in compare_cull_condition()
198 return compare_tgid(p1, p2); in compare_cull_condition()
199 if ((cull & CULL_COMM) && compare_comm(p1, p2)) in compare_cull_condition()
200 return compare_comm(p1, p2); in compare_cull_condition()
201 if ((cull & CULL_ALLOCATOR) && compare_allocator(p1, p2)) in compare_cull_condition()
202 return compare_allocator(p1, p2); in compare_cull_condition()
206 static int compare_sort_condition(const void *p1, const void *p2) in compare_sort_condition() argument
212 cmp = sc.signs[i] * sc.cmps[i](p1, p2); in compare_sort_condition()
222 if (err != 0 || pmatch[1].rm_so == -1) in remove_pattern()
225 memcpy(buf + pmatch[1].rm_so, in remove_pattern()
226 buf + pmatch[1].rm_eo, len - pmatch[1].rm_eo); in remove_pattern()
228 return len - (pmatch[1].rm_eo - pmatch[1].rm_so); in remove_pattern()
237 if (err != 0 || pmatch[1].rm_so == -1) { in search_pattern()
240 return -1; in search_pattern()
242 val_len = pmatch[1].rm_eo - pmatch[1].rm_so; in search_pattern()
244 memcpy(pattern_str, buf + pmatch[1].rm_so, val_len); in search_pattern()
254 if (err != 0 || pattern->re_nsub != 1) { in check_regcomp()
264 int lastindex = -1, j = 0; in explode()
274 memcpy(ret[j++], str + lastindex + 1, i - lastindex - 1); in explode()
278 if (lastindex <= len - 1) { in explode()
280 memcpy(ret[j++], str + lastindex + 1, strlen(str) - 1 - lastindex); in explode()
310 return 1 << order_val; in get_page_num()
325 return -1; in get_pid()
344 return -1; in get_tgid()
363 return -1; in get_ts_nsec()
480 list[list_size].txt = malloc(len+1); in add_list()
491 list[list_size].num = 1; in add_list()
538 if (sc.signs == NULL || sc.size < 1) in set_single_cmp()
539 sc.signs = calloc(1, sizeof(int)); in set_single_cmp()
541 if (sc.cmps == NULL || sc.size < 1) in set_single_cmp()
542 sc.cmps = calloc(1, sizeof(int *)); in set_single_cmp()
544 sc.size = 1; in set_single_cmp()
568 offset = 1; in parse_sort_args()
668 { "pid", required_argument, NULL, 1 }, in main()
678 while ((opt = getopt_long(argc, argv, "admnpstP", longopts, NULL)) != -1) in main()
704 case 1: in main()
710 exit(1); in main()
719 exit(1); in main()
730 exit(1); in main()
737 exit(1); in main()
742 exit(1); in main()
745 if (optind >= (argc - 1)) { in main()
747 exit(1); in main()
780 exit(1); in main()
784 fout = fopen(argv[optind + 1], "w"); in main()
788 exit(1); in main()
832 compare_cull_condition((void *)(&list[count-1]), (void *)(&list[i])) != 0) { in main()
835 list[count-1].num += list[i].num; in main()
836 list[count-1].page_num += list[i].page_num; in main()