From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id 827F8385828F for ; Fri, 22 Jul 2022 21:08:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 827F8385828F Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26MIYMOG030540 for ; Fri, 22 Jul 2022 21:08:41 GMT Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3hbm42rksh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 22 Jul 2022 21:08:41 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 26MKQExK022169 for ; Fri, 22 Jul 2022 21:08:40 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3hc1hvkh5q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 22 Jul 2022 21:08:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nCmsi5A+Bk51haxvLMnvWSiu7uUwjIesWD7Fi032sKctdcfmD9Qu+3A+UnR4VdapAJkOweRAvO+Sm8oqif5rK+QbMeIU6OgZDG94soBmv3gHBkFt98D9O8jcRfvQQcpmDbtPx0B/SQ0GzjAzhR7Sdo9oeQ8gPzYDofsOuRDSo5Eue0hz5bsi6J7TiyVA2aBSQFO72fLYLZQF5vrdWOSb2LZn4NzylNn/j4QZnrBzhW/kMn/VYXX7glkidGPBxp4RXCPuBGxa8ct8d6sqrE8wyrHSdJZursbUk5juUaTYDjoej2OtHRjLouHKzz79A4TyJKA9+U0jqDRAZ35FPDl2ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=49r3kPdPPLMij4LRbjo8pDWIsbABsj6sbcAUoUhbH/0=; b=YYA38VJBC3QC5TgYzD45O8BRSsQ6DQS0zxCO5Zq/nS6j+m6zq38M536zjhj4xkr6Alu7QAWKgZwxzZPJzc/zG62wF85+OfY0ftm1De8hPs8/xWDK9M9aYS0WxZZZIU1C0KWpOiKtHNGMDWo4C98jWxopulRaKkkZ5VRuDTXG28ZFAe5lcLLu5Vs6B4exlB4eQSHosr7mUJ6T6BUqQxRolenP5p9VK/Z4Kh6pLKNpDRXngjaoezlzqmpGEQ+RZp//UtCO6TbzTvngS4KV6YBGcJezpiR4z0nQf9Tv6v4fZry4gEkdhgGxRvk86OwcU2IztS8+Kz3nWyGFaee43kPvpg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none Received: from CO1PR10MB4787.namprd10.prod.outlook.com (2603:10b6:303:9c::16) by SA2PR10MB4794.namprd10.prod.outlook.com (2603:10b6:806:113::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.19; Fri, 22 Jul 2022 21:08:32 +0000 Received: from CO1PR10MB4787.namprd10.prod.outlook.com ([fe80::3d2f:fd7e:15d2:b521]) by CO1PR10MB4787.namprd10.prod.outlook.com ([fe80::3d2f:fd7e:15d2:b521%3]) with mapi id 15.20.5458.019; Fri, 22 Jul 2022 21:08:32 +0000 From: ruud.vanderpas@oracle.com To: binutils@sourceware.org Subject: [PATCH] gprofng: fix bug 29392 - Unexpected line format in summary file Date: Fri, 22 Jul 2022 14:08:25 -0700 Message-Id: <20220722210825.1989857-1-ruud.vanderpas@oracle.com> X-Mailer: git-send-email 2.27.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: DM6PR03CA0099.namprd03.prod.outlook.com (2603:10b6:5:333::32) To CO1PR10MB4787.namprd10.prod.outlook.com (2603:10b6:303:9c::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5e547bc4-925d-4c46-6775-08da6c265583 X-MS-TrafficTypeDiagnostic: SA2PR10MB4794:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2qGi7LIyIQVnIE6fbbW/h02XoD/KVhCT7ZBGvDhkLHQ5mmidYb8I9669R1ApSxv/ZfDsfzeho37ktoUfskLBJplbzgA2j/DoBCnNzYp5n4BfpROGHN4l0FMzS2Zpd3iHWSFVu80syCHSeaZ/xUWyF+yCYicL5/lUn05Bt78IcM1R7SXf6hEm1WP8rs/0vnnH9jAyglWHRGzsdIxkn2FKcRmZ/URf2ZBaXelHWN9ypJ5KXuTb+Dds0MzcHFvP/y8mCQQKhYzCxTJBHj4hb5ImoLev8Qt4RTZQftezQ48EW0emEKHuJv/uW5M9lKhESSdnP78Ayfh1K+dLg2Hoic4GlO0QUHT2BlJ6ijnGruzKJ0AGouaRWHtntETeNN+HLUW2o+0KDvuoHgva/EGpAPUXeA80teCPFQsY45gqc0IplaQAp/p3/IYRG1rGrZ8s/sMw3Ltu86FBb5ZAHT2Aj/9xVTvCK8JhI1graStGEkImB47THqRcRFCHcrhe5gUkRk9B9plUuc8gipzOu0Vgi0edWKES+gFI6I2gS7bcMgDOpsX1Rlen2VAGXChbk2s6V7SKkQtxLacKSkJVhlr3m2ae4vhbs3ogiEcvUrCdRBlv+nlHmNlpmUAFKCfJ4Lrzn/43KTPpxXsnyd+Smh0McN1zASj91N/roYdBtVIpF+6MxxyfJ0fMIqRKsyUjzCTVtgIxXmAboCSGwzE3UXIxfIZ9jzW8w0U48RgXvpIJ4Evu6ArB4BJILBwgvIIqSLhpLrAh X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR10MB4787.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(366004)(346002)(396003)(136003)(376002)(39860400002)(6506007)(38100700002)(52116002)(6486002)(86362001)(5660300002)(186003)(2616005)(107886003)(36756003)(316002)(6916009)(9686003)(6512007)(83380400001)(1076003)(8676002)(66556008)(4326008)(66476007)(8936002)(2906002)(478600001)(66946007)(6666004)(41300700001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Y4ewR8tErVjrcnN8FM66CqBRFvQ1SI3HRTDeS82YcY9PhkNZQikar5vT+DOK?= =?us-ascii?Q?K29Nx2swCCS+BhF/hMzVWta8z3xv4H+sr/OelZgdcqU91vlre7KGJsuN+Odt?= =?us-ascii?Q?Fl+zv8bWuyRQP4ftOCbZE9hJ1mv6AT89kZwbylLxk1T/p2/L+vgpUquHlYjd?= =?us-ascii?Q?NEmTXK1R9L8wNTzGDAUNP5NoURl1WWEyuV836OlZdSaHG2vK6VZCwV2Oo0r4?= =?us-ascii?Q?fU5pd0fTv7eUNDr+c9HKNQHjUs4VtW0enFI6HLtvBF9rvEw4MgWi3lCOGY2K?= =?us-ascii?Q?WbV2mR4IRLDSGsbSEJQHcDPcMbHfq6DFq98zKzwfO5cysrx562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5do3Pm2CgPkONJU7r3YwhV22AeAtoPm8FsVdneF3sc0p1aBlBkrOOPj+6i?= =?us-ascii?Q?6fvlo/QUav1wzUoY/tqK5DQYy8FS1dDbcMLdVWgew0s21TmXCwA+FM/P31jY?= =?us-ascii?Q?TolSL3PVgDpcAyVNpG/ZVubF8lkuAIrgegqdHkJuAloVcV7JskD2mPLbAZqt?= =?us-ascii?Q?hqK+RBKRVc4OVxqfsYQ4dhf8rNr0g+uyBWFNS0l2ZNidGim8/46XOgX76Wed?= =?us-ascii?Q?ZnEmsCVMj/WRNpOdgArRhueJCMOf/4HW5+Aqp+LRTiJq4kYt1fARNcWBTUp7?= =?us-ascii?Q?UMoqvaraFIC0PxwLvwLQRHCvybmgAXDoVSR0BYA6f7hoM/E6p+8lUZIgobi1?= =?us-ascii?Q?YMY0X4L9vxcCcTHpUELPmc+vmRluSoOIHSgz/HitsRfgszrGINLiyJfD+riF?= =?us-ascii?Q?ljFTsg/T3Mq7nvoRu5Hiu/Y=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5e547bc4-925d-4c46-6775-08da6c265583 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4787.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2022 21:08:32.7765 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: X/Ba/14HOUgqsgmLJYOtkQ0JofnJa4yHVe2ouexkOkqb3FQyqL8vzhfpIWobxvZ/sRnWTpkASEhKPqZ6myvJLjLnJs4o6BN044UFlG+/bZ0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4794 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-07-22_06,2022-07-21_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 malwarescore=0 mlxscore=0 phishscore=0 mlxlogscore=999 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207220087 X-Proofpoint-ORIG-GUID: TArFjTcIFQmSF5DX5FZj-Q8mWz__EbIh X-Proofpoint-GUID: TArFjTcIFQmSF5DX5FZj-Q8mWz__EbIh X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jul 2022 21:08:43 -0000 From: Ruud van der Pas gprofng/Changelog: 2022-07-22 Ruud van der Pas * gp-display-html/gp-display-html.in: modified a regex, plus the code to handle the results; renamed a variable to improve the consistency in naming. --- gprofng/gp-display-html/gp-display-html.in | 101 ++++++++++++++++----- 1 file changed, 79 insertions(+), 22 deletions(-) diff --git a/gprofng/gp-display-html/gp-display-html.in b/gprofng/gp-display-html/gp-display-html.in index 54a87d7a3c7..c7a013970e1 100644 --- a/gprofng/gp-display-html/gp-display-html.in +++ b/gprofng/gp-display-html/gp-display-html.in @@ -7469,11 +7469,16 @@ sub get_function_info my ($FSUMMARY_FILE) = @_; - my @function_info = (); - my %functions_address_and_index = (); - my %LINUX_vDSO = (); - my %function_view_structure = (); - my %addressobjtextm = (); +#------------------------------------------------------------------------------ +# The regex section. +#------------------------------------------------------------------------------ + my $white_space_regex = '\s*'; + + my @function_info = (); + my %function_address_and_index = (); + my %LINUX_vDSO = (); + my %function_view_structure = (); + my %addressobjtextm = (); #------------------------------------------------------------------------------ # TBD: This structure is no longer used and most likely can be removed. #------------------------------------------------------------------------------ @@ -7672,14 +7677,53 @@ sub get_function_info # or: # Source File: /name_of_source_file #------------------------------------------------------------------------------ - if ( not ($line =~ /^(\s*)(.*):(\s+)([^\s]+|(.*))/)) + $line =~ s/^\s+//; + + my @input_fields = split (":", $line); + my $no_of_elements = scalar (@input_fields); + + gp_message ("debugXL", $subr_name, "#input_fields = $#input_fields"); + gp_message ("debugXL", $subr_name, "no_of_elements = $no_of_elements"); + gp_message ("debugXL", $subr_name, "input_fields[0] = $input_fields[0]"); + + if ($no_of_elements == 1) + { + $whatever = $input_fields[0]; + $value = ""; + } + elsif ($no_of_elements == 2) + { +#------------------------------------------------------------------------------ +# Note that value may consist of multiple fields (e.g. 1.651 ( 95.4%)). +#------------------------------------------------------------------------------ + $whatever = $input_fields[0]; + $value = $input_fields[1]; + } + elsif ($no_of_elements == 3) { - my $msg = "unexpected line format in summary file $FSUMMARY_FILE line = $line"; +#------------------------------------------------------------------------------ +# Assumption: must be an address field. Restore the second colon. +#------------------------------------------------------------------------------ + $whatever = $input_fields[0]; + $value = $input_fields[1] . ":" . $input_fields[2]; + } + else + { + my $msg = "unexpected: number of fields = " . $no_of_elements; gp_message ("assertion", $subr_name, $msg); } - $whatever = $2; - $value = $4; +#------------------------------------------------------------------------------ +# Remove any leading whitespace characters. +#------------------------------------------------------------------------------ + $value =~ s/$white_space_regex//; + + gp_message ("debugXL", $subr_name, "whatever = $whatever value = $value"); + $function_info[$i]{$whatever} = $value; + +#------------------------------------------------------------------------------ +# TBD: Seems to be not used anymore and can most likely be removed. Check this. +#------------------------------------------------------------------------------ if ($whatever =~ /Source File/) { if (!exists ($source_files{$value})) @@ -7707,7 +7751,7 @@ sub get_function_info #------------------------------------------------------------------------------ # Convert to a base 10 number #------------------------------------------------------------------------------ - $address_decimal = hex ($offset); # decimal + $address_decimal = bigint::hex ($offset); # decimal #------------------------------------------------------------------------------ # Construct the address field. Note that we use the hex address here. #------------------------------------------------------------------------------ @@ -7717,9 +7761,13 @@ sub get_function_info $function_info[$i]{"addressobjtext"} = $full_address_field; $addressobjtextm{$full_address_field} = $i; # $RI } - if (not exists ($functions_address_and_index{$routine}{$value})) + if (not exists ($function_address_and_index{$routine}{$value})) { - $functions_address_and_index{$routine}{$value} = $i; + $function_address_and_index{$routine}{$value} = $i; + + my $msg = "function_address_and_index{$routine}{$value} = " . + $function_address_and_index{$routine}{$value}; + gp_message ("debugXL", $subr_name, $msg); } else { @@ -7948,13 +7996,13 @@ sub get_function_info } } #------------------------------------------------------------------------------ -# Print the data structure %functions_address_and_index. This is a nested hash. +# Print the data structure %function_address_and_index. This is a nested hash. #------------------------------------------------------------------------------ - for my $F (keys %functions_address_and_index) + for my $F (keys %function_address_and_index) { - for my $fields (sort keys %{ $functions_address_and_index{$F} }) + for my $fields (sort keys %{ $function_address_and_index{$F} }) { - gp_message ("debug", $subr_name, "on return: functions_address_and_index{$F}{$fields} = $functions_address_and_index{$F}{$fields}"); + gp_message ("debug", $subr_name, "on return: function_address_and_index{$F}{$fields} = $function_address_and_index{$F}{$fields}"); } } #------------------------------------------------------------------------------ @@ -8025,10 +8073,10 @@ sub get_function_info $multi_occurrences; gp_message ("debug", $subr_name, $msg); - return (\@function_info, \%functions_address_and_index, \%addressobjtextm, \%LINUX_vDSO, \%function_view_structure); + return (\@function_info, \%function_address_and_index, \%addressobjtextm, + \%LINUX_vDSO, \%function_view_structure); } #-- End of subroutine get_function_info - #------------------------------------------------------------------------------ # TBD #------------------------------------------------------------------------------ @@ -9847,12 +9895,12 @@ sub parse_dis_files my $subr_name = get_my_name (); my ($number_of_metrics_ref, $function_info_ref, - $functions_address_and_index_ref, $input_string_ref, + $function_address_and_index_ref, $input_string_ref, $addressobj_index_ref) = @_; #------------------------------------------------------------------------------ -# Note that $functions_address_and_index_ref are is not used, -# but we need to pass in the address into generate_dis_html. +# Note that $function_address_and_index_ref is not used, but we need to pass +# in the address into generate_dis_html. #------------------------------------------------------------------------------ my $number_of_metrics = ${ $number_of_metrics_ref }; my @function_info = @{ $function_info_ref }; @@ -9916,7 +9964,7 @@ sub parse_dis_files \$target_function, \$number_of_metrics, $function_info_ref, - $functions_address_and_index_ref, + $function_address_and_index_ref, \$outputdir, \$filename, \@source_line, @@ -11005,6 +11053,15 @@ sub process_function_files { $PCA = $function_address_info{$metric}[$INDEX]{"PC Address"}; + if (not exists ($functions_per_metric_first_index{$metric}{$routine}{$PCA})) + { + gp_message ("debugXL", $subr_name, "not exists: functions_per_metric_first_index{$metric}{$routine}{$PCA}"); + } + if (not exists ($function_address_and_index{$routine}{$PCA})) + { + gp_message ("debugXL", $subr_name, "not exists: function_address_and_index{$routine}{$PCA}"); + } + if (exists ($functions_per_metric_first_index{$metric}{$routine}{$PCA}) and exists ($function_address_and_index{$routine}{$PCA})) { -- 2.27.0