All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v2] perf tools: Add machine pointer to struct hists
Date: Tue, 28 Jan 2020 11:02:54 +0100	[thread overview]
Message-ID: <20200128100254.GD1209308@krava> (raw)
In-Reply-To: <20200128004213.106098-1-namhyung@kernel.org>

On Tue, Jan 28, 2020 at 09:42:13AM +0900, Namhyung Kim wrote:

SNIP

> +struct perf_session;
>  
>  static inline struct perf_cpu_map *evsel__cpus(struct evsel *evsel)
>  {
> @@ -145,32 +146,43 @@ void perf_evsel__compute_deltas(struct evsel *evsel, int cpu, int thread,
>  				struct perf_counts_values *count);
>  
>  int perf_evsel__object_config(size_t object_size,
> -			      int (*init)(struct evsel *evsel),
> -			      void (*fini)(struct evsel *evsel));
> +			      int (*init)(struct evsel *evsel,
> +					  struct perf_session *session),
> +			      void (*fini)(struct evsel *evsel,
> +					   struct perf_session *session));
>  
> -struct evsel *perf_evsel__new_idx(struct perf_event_attr *attr, int idx);
> +struct evsel *perf_evsel__new_idx(struct perf_event_attr *attr, int idx,
> +				  struct perf_session *session);
>  
>  static inline struct evsel *evsel__new(struct perf_event_attr *attr)
>  {
> -	return perf_evsel__new_idx(attr, 0);
> +	return perf_evsel__new_idx(attr, 0, NULL);
>  }
>  
> -struct evsel *perf_evsel__newtp_idx(const char *sys, const char *name, int idx);
> +static inline struct evsel *evsel__new2(struct perf_event_attr *attr,
> +					struct perf_session *session)
> +{
> +	return perf_evsel__new_idx(attr, 0, session);
> +}

I'm not sure about perf_session as an argument to get machine,
it seems ok but not for the case in perf_event__process_attr
where you call evsel__new and have no way to get perf_sesion
I think... and I think you need to set it up in there for
the pipe workflow to work with your new sort fields

maybe we could be find with just perf_env pointer there?
but perf_session makes more sense to me.. maybe we could
change event_attr_op to pass it as an argument..

jirka

      reply	other threads:[~2020-01-28 10:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-27 14:34 [PATCH] perf tools: Add machine pointer to struct hists Namhyung Kim
2020-01-28  0:42 ` [PATCH v2] " Namhyung Kim
2020-01-28 10:02   ` Jiri Olsa [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200128100254.GD1209308@krava \
    --to=jolsa@redhat.com \
    --cc=acme@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=namhyung@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.