Add information about line contents on parsing failure of wait_event_names.txt
authorMichael Paquier
Fri, 14 Jul 2023 00:09:23 +0000 (09:09 +0900)
committerMichael Paquier
Fri, 14 Jul 2023 00:09:23 +0000 (09:09 +0900)
The contents of the line whose parsing failed was not reported in the
error message produced by generate-wait_event_types.pl, making harder
than necessary the debugging of incorrectly-shaped entries in the file.

Reported-by: Andres Freund
Discussion: https://postgr.es/m/[email protected]

src/backend/utils/activity/generate-wait_event_types.pl

index 2a9e341c584f3ef9255f9a9e1deb437b7f652b44..f63c99105195051302e1296f4474f210236bbddd 100644 (file)
@@ -72,7 +72,7 @@ my @lines_sorted =
 # Read the sorted lines and populate the hash table
 foreach my $line (@lines_sorted)
 {
-   die "unable to parse wait_event_names.txt"
+   die "unable to parse wait_event_names.txt for line $line\n"
      unless $line =~ /^(\w+)\t+(\w+)\t+(\w+)\t+("\w.*\.")$/;
 
    (   my $waitclassname,