Lines Matching refs:iip
94 struct ifile_info *iip; member
291 static void rem_input_file(struct ifile_info *iip) in rem_input_file() argument
293 list_del(&iip->head); in rem_input_file()
295 close(iip->ifd); in rem_input_file()
296 free(iip->file_name); in rem_input_file()
297 free(iip->devnm); in rem_input_file()
298 free(iip); in rem_input_file()
309 struct ifile_info *iip = malloc(sizeof(*iip)); in __add_input_file() local
311 iip->cpu = cpu; in __add_input_file()
312 iip->tpkts = 0; in __add_input_file()
313 iip->genesis = 0; in __add_input_file()
314 iip->devnm = strdup(devnm); in __add_input_file()
315 iip->file_name = strdup(file_name); in __add_input_file()
316 iip->ifd = open(file_name, O_RDONLY); in __add_input_file()
317 if (iip->ifd < 0) { in __add_input_file()
322 list_add_tail(&iip->head, &input_files); in __add_input_file()
335 struct ifile_info *iip = list_entry(p, struct ifile_info, head); in add_input_file() local
336 if (strcmp(iip->devnm, devnm) == 0) in add_input_file()
486 static int next_io(struct ifile_info *iip, struct io_spec *spec) in next_io() argument
494 ret = read(iip->ifd, &t, sizeof(t)); in next_io()
496 fatal(iip->file_name, ERR_SYSCALL, "Read failed\n"); in next_io()
503 iip->file_name, (int)ret); in next_io()
530 ret = read(iip->ifd, buf, pdu_len); in next_io()
532 fatal(iip->file_name, ERR_SYSCALL, "Read PDU failed\n"); in next_io()
537 iip->file_name, (int)ret); in next_io()
542 iip->tpkts++; in next_io()
549 iip->cpu, (long long unsigned)spec->sector, in next_io()
553 if (iip->genesis == 0) { in next_io()
554 iip->genesis = spec->time; in next_io()
557 (long long unsigned)iip->genesis, iip->cpu); in next_io()
559 else if (iip->genesis > spec->time) in next_io()
562 (long long unsigned )iip->genesis, in next_io()
582 __u64 off = hdrp->time_stamp - stream->iip->genesis; in bunch_output_hdr()
679 static struct io_stream *stream_open(struct ifile_info *iip) in stream_open() argument
691 sprintf(ofile_name, "%s/%s.%s.%d", odir, iip->devnm, obase, iip->cpu); in stream_open()
698 stream->iip = iip; in stream_open()
709 sprintf(vfile_name, "%s/%s.%s.%d.rec", odir, iip->devnm, in stream_open()
710 obase, iip->cpu); in stream_open()
731 .genesis = stream->iip->genesis, in stream_close()
744 stream->iip->devnm, stream->iip->cpu, in stream_close()
745 (unsigned long long)stream->iip->tpkts, in stream_close()
762 static void process(struct ifile_info *iip) in process() argument
767 stream = stream_open(iip); in process()
768 while (next_io(iip, &spec)) in process()
772 rem_input_file(iip); in process()