public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* linux-next: manual merge of the perf tree with the origin tree
@ 2022-08-05 11:45 broonie
  0 siblings, 0 replies; 4+ messages in thread
From: broonie @ 2022-08-05 11:45 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Andres Freund, Andrii Nakryiko, Arnaldo Carvalho de Melo,
	Linux Kernel Mailing List, Linux Next Mailing List,
	Quentin Monnet

Hi all,

Today's linux-next merge of the perf tree got a conflict in:

  tools/bpf/bpftool/Makefile

between commit:

  450a8dcb8c7f8 ("bpftool: Remove zlib feature test from Makefile")

from the origin tree and commit:

  1e1613f64cc8a ("tools bpftool: Don't display disassembler-four-args feature test")

from the perf tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

diff --cc tools/bpf/bpftool/Makefile
index 6b5b3a99f79d4,517df016d54a2..0000000000000
--- a/tools/bpf/bpftool/Makefile
+++ b/tools/bpf/bpftool/Makefile
@@@ -93,8 -93,9 +93,8 @@@ INSTALL ?= instal
  RM ?= rm -f
  
  FEATURE_USER = .bpftool
 -FEATURE_TESTS = libbfd disassembler-four-args disassembler-init-styled zlib libcap \
 -	clang-bpf-co-re
 -FEATURE_DISPLAY = libbfd zlib libcap clang-bpf-co-re
 +FEATURE_TESTS = libbfd disassembler-four-args libcap clang-bpf-co-re
- FEATURE_DISPLAY = libbfd disassembler-four-args libcap clang-bpf-co-re
++FEATURE_DISPLAY = libbfd libcap clang-bpf-co-re
  
  check_feat := 1
  NON_CHECK_FEAT_TARGETS := clean uninstall doc doc-clean doc-install doc-uninstall

^ permalink raw reply	[flat|nested] 4+ messages in thread

* linux-next: manual merge of the perf tree with the origin tree
@ 2024-06-17 16:19 broonie
  0 siblings, 0 replies; 4+ messages in thread
From: broonie @ 2024-06-17 16:19 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Namhyung Kim
  Cc: Arnaldo Carvalho de Melo, Ian Rogers, Linux Kernel Mailing List,
	Linux Next Mailing List

Hi all,

Today's linux-next merge of the perf tree got a conflict in:

  tools/perf/builtin-record.c

between commit:

  5b3cde198878b ("Revert "perf record: Reduce memory for recording PERF_RECORD_LOST_SAMPLES event"")

from the origin tree and commit:

  6c1785cd75ef5 ("perf record: Ensure space for lost samples")

from the perf tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 0a8ba1323d64b..019305b94e5fc 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -1926,7 +1926,7 @@ static void __record__save_lost_samples(struct record *rec, struct evsel *evsel,
 static void record__read_lost_samples(struct record *rec)
 {
 	struct perf_session *session = rec->session;
-	struct perf_record_lost_samples *lost = NULL;
+	struct perf_record_lost_samples_and_ids lost;
 	struct evsel *evsel;
 
 	/* there was an error during record__open */
@@ -1951,19 +1951,13 @@ static void record__read_lost_samples(struct record *rec)
 
 				if (perf_evsel__read(&evsel->core, x, y, &count) < 0) {
 					pr_debug("read LOST count failed\n");
-					goto out;
+					return;
 				}
 
 				if (count.lost) {
-					if (!lost) {
-						lost = zalloc(PERF_SAMPLE_MAX_SIZE);
-						if (!lost) {
-							pr_debug("Memory allocation failed\n");
-							return;
-						}
-						lost->header.type = PERF_RECORD_LOST_SAMPLES;
-					}
-					__record__save_lost_samples(rec, evsel, lost,
+					memset(&lost.lost, 0, sizeof(lost));
+					lost.lost.header.type = PERF_RECORD_LOST_SAMPLES;
+					__record__save_lost_samples(rec, evsel, &lost.lost,
 								    x, y, count.lost, 0);
 				}
 			}
@@ -1971,20 +1965,12 @@ static void record__read_lost_samples(struct record *rec)
 
 		lost_count = perf_bpf_filter__lost_count(evsel);
 		if (lost_count) {
-			if (!lost) {
-				lost = zalloc(PERF_SAMPLE_MAX_SIZE);
-				if (!lost) {
-					pr_debug("Memory allocation failed\n");
-					return;
-				}
-				lost->header.type = PERF_RECORD_LOST_SAMPLES;
-			}
-			__record__save_lost_samples(rec, evsel, lost, 0, 0, lost_count,
+			memset(&lost.lost, 0, sizeof(lost));
+			lost.lost.header.type = PERF_RECORD_LOST_SAMPLES;
+			__record__save_lost_samples(rec, evsel, &lost.lost, 0, 0, lost_count,
 						    PERF_RECORD_MISC_LOST_SAMPLES_BPF);
 		}
 	}
-out:
-	free(lost);
 }
 
 static volatile sig_atomic_t workload_exec_errno;
@@ -3196,7 +3182,7 @@ static int switch_output_setup(struct record *rec)
 	unsigned long val;
 
 	/*
-	 * If we're using --switch-output-events, then we imply its 
+	 * If we're using --switch-output-events, then we imply its
 	 * --switch-output=signal, as we'll send a SIGUSR2 from the side band
 	 *  thread to its parent.
 	 */

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* linux-next: manual merge of the perf tree with the origin tree
@ 2024-06-17 16:23 Mark Brown
  2024-06-18  3:21 ` Namhyung Kim
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2024-06-17 16:23 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Namhyung Kim
  Cc: Arnaldo Carvalho de Melo, Ian Rogers, Linux Kernel Mailing List,
	Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 3148 bytes --]

Hi all,

Today's linux-next merge of the perf tree got a conflict in:

  tools/perf/builtin-record.c

between commit:

  5b3cde198878b ("Revert "perf record: Reduce memory for recording PERF_RECORD_LOST_SAMPLES event"")

from the origin tree and commit:

  6c1785cd75ef5 ("perf record: Ensure space for lost samples")

from the perf tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 0a8ba1323d64b..019305b94e5fc 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -1926,7 +1926,7 @@ static void __record__save_lost_samples(struct record *rec, struct evsel *evsel,
 static void record__read_lost_samples(struct record *rec)
 {
 	struct perf_session *session = rec->session;
-	struct perf_record_lost_samples *lost = NULL;
+	struct perf_record_lost_samples_and_ids lost;
 	struct evsel *evsel;
 
 	/* there was an error during record__open */
@@ -1951,19 +1951,13 @@ static void record__read_lost_samples(struct record *rec)
 
 				if (perf_evsel__read(&evsel->core, x, y, &count) < 0) {
 					pr_debug("read LOST count failed\n");
-					goto out;
+					return;
 				}
 
 				if (count.lost) {
-					if (!lost) {
-						lost = zalloc(PERF_SAMPLE_MAX_SIZE);
-						if (!lost) {
-							pr_debug("Memory allocation failed\n");
-							return;
-						}
-						lost->header.type = PERF_RECORD_LOST_SAMPLES;
-					}
-					__record__save_lost_samples(rec, evsel, lost,
+					memset(&lost.lost, 0, sizeof(lost));
+					lost.lost.header.type = PERF_RECORD_LOST_SAMPLES;
+					__record__save_lost_samples(rec, evsel, &lost.lost,
 								    x, y, count.lost, 0);
 				}
 			}
@@ -1971,20 +1965,12 @@ static void record__read_lost_samples(struct record *rec)
 
 		lost_count = perf_bpf_filter__lost_count(evsel);
 		if (lost_count) {
-			if (!lost) {
-				lost = zalloc(PERF_SAMPLE_MAX_SIZE);
-				if (!lost) {
-					pr_debug("Memory allocation failed\n");
-					return;
-				}
-				lost->header.type = PERF_RECORD_LOST_SAMPLES;
-			}
-			__record__save_lost_samples(rec, evsel, lost, 0, 0, lost_count,
+			memset(&lost.lost, 0, sizeof(lost));
+			lost.lost.header.type = PERF_RECORD_LOST_SAMPLES;
+			__record__save_lost_samples(rec, evsel, &lost.lost, 0, 0, lost_count,
 						    PERF_RECORD_MISC_LOST_SAMPLES_BPF);
 		}
 	}
-out:
-	free(lost);
 }
 
 static volatile sig_atomic_t workload_exec_errno;
@@ -3196,7 +3182,7 @@ static int switch_output_setup(struct record *rec)
 	unsigned long val;
 
 	/*
-	 * If we're using --switch-output-events, then we imply its 
+	 * If we're using --switch-output-events, then we imply its
 	 * --switch-output=signal, as we'll send a SIGUSR2 from the side band
 	 *  thread to its parent.
 	 */

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: linux-next: manual merge of the perf tree with the origin tree
  2024-06-17 16:23 linux-next: manual merge of the perf tree with the origin tree Mark Brown
@ 2024-06-18  3:21 ` Namhyung Kim
  0 siblings, 0 replies; 4+ messages in thread
From: Namhyung Kim @ 2024-06-18  3:21 UTC (permalink / raw)
  To: Mark Brown
  Cc: Arnaldo Carvalho de Melo, Arnaldo Carvalho de Melo, Ian Rogers,
	Linux Kernel Mailing List, Linux Next Mailing List

Hello,

On Mon, Jun 17, 2024 at 05:23:02PM +0100, Mark Brown wrote:
> Hi all,
> 
> Today's linux-next merge of the perf tree got a conflict in:
> 
>   tools/perf/builtin-record.c
> 
> between commit:
> 
>   5b3cde198878b ("Revert "perf record: Reduce memory for recording PERF_RECORD_LOST_SAMPLES event"")
> 
> from the origin tree and commit:
> 
>   6c1785cd75ef5 ("perf record: Ensure space for lost samples")
> 
> from the perf tree.
> 
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.

Thanks for doing this!  The resolution looks good.  I plan to merge
the revert and other fixes in the v6.10 tree into perf-tools-next
before v6.11 window open.

Thanks,
Namhyung

> 
> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
> index 0a8ba1323d64b..019305b94e5fc 100644
> --- a/tools/perf/builtin-record.c
> +++ b/tools/perf/builtin-record.c
> @@ -1926,7 +1926,7 @@ static void __record__save_lost_samples(struct record *rec, struct evsel *evsel,
>  static void record__read_lost_samples(struct record *rec)
>  {
>  	struct perf_session *session = rec->session;
> -	struct perf_record_lost_samples *lost = NULL;
> +	struct perf_record_lost_samples_and_ids lost;
>  	struct evsel *evsel;
>  
>  	/* there was an error during record__open */
> @@ -1951,19 +1951,13 @@ static void record__read_lost_samples(struct record *rec)
>  
>  				if (perf_evsel__read(&evsel->core, x, y, &count) < 0) {
>  					pr_debug("read LOST count failed\n");
> -					goto out;
> +					return;
>  				}
>  
>  				if (count.lost) {
> -					if (!lost) {
> -						lost = zalloc(PERF_SAMPLE_MAX_SIZE);
> -						if (!lost) {
> -							pr_debug("Memory allocation failed\n");
> -							return;
> -						}
> -						lost->header.type = PERF_RECORD_LOST_SAMPLES;
> -					}
> -					__record__save_lost_samples(rec, evsel, lost,
> +					memset(&lost.lost, 0, sizeof(lost));
> +					lost.lost.header.type = PERF_RECORD_LOST_SAMPLES;
> +					__record__save_lost_samples(rec, evsel, &lost.lost,
>  								    x, y, count.lost, 0);
>  				}
>  			}
> @@ -1971,20 +1965,12 @@ static void record__read_lost_samples(struct record *rec)
>  
>  		lost_count = perf_bpf_filter__lost_count(evsel);
>  		if (lost_count) {
> -			if (!lost) {
> -				lost = zalloc(PERF_SAMPLE_MAX_SIZE);
> -				if (!lost) {
> -					pr_debug("Memory allocation failed\n");
> -					return;
> -				}
> -				lost->header.type = PERF_RECORD_LOST_SAMPLES;
> -			}
> -			__record__save_lost_samples(rec, evsel, lost, 0, 0, lost_count,
> +			memset(&lost.lost, 0, sizeof(lost));
> +			lost.lost.header.type = PERF_RECORD_LOST_SAMPLES;
> +			__record__save_lost_samples(rec, evsel, &lost.lost, 0, 0, lost_count,
>  						    PERF_RECORD_MISC_LOST_SAMPLES_BPF);
>  		}
>  	}
> -out:
> -	free(lost);
>  }
>  
>  static volatile sig_atomic_t workload_exec_errno;
> @@ -3196,7 +3182,7 @@ static int switch_output_setup(struct record *rec)
>  	unsigned long val;
>  
>  	/*
> -	 * If we're using --switch-output-events, then we imply its 
> +	 * If we're using --switch-output-events, then we imply its
>  	 * --switch-output=signal, as we'll send a SIGUSR2 from the side band
>  	 *  thread to its parent.
>  	 */



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-06-18  3:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-17 16:23 linux-next: manual merge of the perf tree with the origin tree Mark Brown
2024-06-18  3:21 ` Namhyung Kim
  -- strict thread matches above, loose matches on Subject: below --
2024-06-17 16:19 broonie
2022-08-05 11:45 broonie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox