Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1644724

Re: [PATCH 7/7] perf tools: add feature header record to pipe-mode

From Jiri Olsa <jolsa@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 7/7] perf tools: add feature header record to pipe-mode
Date 2017-05-18 18:20 +0200
Message-ID <tIwjE-58a-17@gated-at.bofh.it> (permalink)
References <tIl4S-4Ep-3@gated-at.bofh.it> <tIl4S-4Ep-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, May 17, 2017 at 09:16:02PM -0700, David Carrillo-Cisneros wrote:

SNIP

>  struct header_print_data {
> @@ -2218,33 +2258,33 @@ int perf_header__fprintf_info(struct perf_session *session, FILE *fp, bool full)
>  	return 0;
>  }
>  
> -static int do_write_feat(struct feat_fd *fd, struct perf_header *h, int type,
> +static int do_write_feat(struct feat_fd *fdd, int type,
>  			 struct perf_file_section **p,
>  			 struct perf_evlist *evlist)
>  {
>  	int err;
>  	int ret = 0;
>  
> -	if (perf_header__has_feat(h, type)) {
> +	if (perf_header__has_feat(fdd->ph, type)) {

please do these changes in the earlier patch that introduced
the feat_fd as parameter in do_write_feat function

thanks,
jirka

>  		if (!feat_ops[type].write)
>  			return -1;
>  
> -		if (fd->buf) {
> -			pr_err("do_write_feat to memory buffer\n");
> +		if (fdd->buf) {
> +			pr_debug("Called do_write_feat for memory buffer\n");
>  			return -1;
>  		}
> -		(*p)->offset = lseek(fd->fd, 0, SEEK_CUR);
> +		(*p)->offset = lseek(fdd->fd, 0, SEEK_CUR);
>  
> -		err = feat_ops[type].write(fd, evlist);
> +		err = feat_ops[type].write(fdd, evlist);
>  		if (err < 0) {
>  			pr_debug("failed to write feature %s\n", feat_ops[type].name);
>  
>  			/* undo anything written */
> -			lseek(fd->fd, (*p)->offset, SEEK_SET);
> +			lseek(fdd->fd, (*p)->offset, SEEK_SET);
>  
>  			return -1;
>  		}
> -		(*p)->size = lseek(fd->fd, 0, SEEK_CUR) - (*p)->offset;
> +		(*p)->size = lseek(fdd->fd, 0, SEEK_CUR) - (*p)->offset;
>  		(*p)++;
>  	}
>  	return ret;
> @@ -2261,10 +2301,6 @@ static int perf_header__adds_write(struct perf_header *header,
>  	int feat;
>  	int err;
>  
> -	/*
> -	 * may write more than needed due to dropped feature, but
> -	 * this is okay, reader will skip the mising entries
> -	 */
>  	fdd = (struct feat_fd){
>  		.fd  = fd,
>  		.ph = header,
> @@ -2284,7 +2320,7 @@ static int perf_header__adds_write(struct perf_header *header,
>  	lseek(fd, sec_start + sec_size, SEEK_SET);
>  
>  	for_each_set_bit(feat, header->adds_features, HEADER_FEAT_BITS) {
> -		if (do_write_feat(&fdd, header, feat, &p, evlist))
> +		if (do_write_feat(&fdd, feat, &p, evlist))
>  			perf_header__clear_feat(header, feat);

SNIP

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 7/7] perf tools: add feature header record to pipe-mode David Carrillo-Cisneros <davidcc@google.com> - 2017-05-18 06:20 +0200
  Re: [PATCH 7/7] perf tools: add feature header record to pipe-mode Jiri Olsa <jolsa@redhat.com> - 2017-05-18 18:20 +0200
    Re: [PATCH 7/7] perf tools: add feature header record to pipe-mode David Carrillo-Cisneros <davidcc@google.com> - 2017-05-18 20:40 +0200
  Re: [PATCH 7/7] perf tools: add feature header record to pipe-mode Jiri Olsa <jolsa@redhat.com> - 2017-05-18 18:20 +0200
    Re: [PATCH 7/7] perf tools: add feature header record to pipe-mode David Carrillo-Cisneros <davidcc@google.com> - 2017-05-18 20:30 +0200
  Re: [PATCH 7/7] perf tools: add feature header record to pipe-mode Jiri Olsa <jolsa@redhat.com> - 2017-05-18 18:20 +0200
  Re: [PATCH 7/7] perf tools: add feature header record to pipe-mode Jiri Olsa <jolsa@redhat.com> - 2017-05-18 18:20 +0200
  Re: [PATCH 7/7] perf tools: add feature header record to pipe-mode Jiri Olsa <jolsa@redhat.com> - 2017-05-18 18:20 +0200
    Re: [PATCH 7/7] perf tools: add feature header record to pipe-mode David Carrillo-Cisneros <davidcc@google.com> - 2017-05-18 20:30 +0200

csiph-web