LCOV - differential code coverage report
Current view: top level - src/backend/storage/page - checksum.c (source / functions) Coverage Total Hit UNC GNC
Current: bed3ffbf9d952be6c7d739d068cdce44c046dfb7 vs 574581b50ac9c63dd9e4abebb731a3b67e5b50f6 Lines: 85.7 % 7 6 1 6
Current Date: 2026-05-05 10:23:31 +0900 Functions: 66.7 % 3 2 1 2
Baseline: lcov-20260505-025707-baseline Branches: 50.0 % 2 1 1 1
Baseline Date: 2026-05-05 10:27:06 +0900 Line coverage date bins:
Legend: Lines:     hit not hit
Branches: + taken - not taken # not executed
(30,360] days: 85.7 % 7 6 1 6
Function coverage date bins:
(30,360] days: 66.7 % 3 2 1 2
Branch coverage date bins:
(30,360] days: 50.0 % 2 1 1 1

 Age         Owner                    Branch data    TLA  Line data    Source code
                                  1                 :                : /*-------------------------------------------------------------------------
                                  2                 :                :  *
                                  3                 :                :  * checksum.c
                                  4                 :                :  *    Checksum implementation for data pages.
                                  5                 :                :  *
                                  6                 :                :  * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
                                  7                 :                :  * Portions Copyright (c) 1994, Regents of the University of California
                                  8                 :                :  *
                                  9                 :                :  * IDENTIFICATION
                                 10                 :                :  *    src/backend/storage/page/checksum.c
                                 11                 :                :  *
                                 12                 :                :  *-------------------------------------------------------------------------
                                 13                 :                :  */
                                 14                 :                : #include "postgres.h"
                                 15                 :                : 
                                 16                 :                : #include "port/pg_cpu.h"
                                 17                 :                : #include "storage/checksum.h"
                                 18                 :                : /*
                                 19                 :                :  * The actual code is in storage/checksum_impl.h.  This is done so that
                                 20                 :                :  * external programs can incorporate the checksum code by #include'ing
                                 21                 :                :  * that file from the exported Postgres headers.  (Compare our legacy
                                 22                 :                :  * CRC code in pg_crc.h.)
                                 23                 :                :  * The PG_CHECKSUM_INTERNAL symbol allows core to use hardware-specific
                                 24                 :                :  * coding without affecting external programs.
                                 25                 :                :  */
                                 26                 :                : #define PG_CHECKSUM_INTERNAL
                                 27                 :                : #include "storage/checksum_impl.h"    /* IWYU pragma: keep */
                                 28                 :                : 
                                 29                 :                : 
                                 30                 :                : static uint32
   31 john.naylor@postgres       31                 :UNC           0 : pg_checksum_block_fallback(const PGChecksummablePage *page)
                                 32                 :                : {
                                 33                 :                : #include "storage/checksum_block_internal.h"
                                 34                 :                : }
                                 35                 :                : 
                                 36                 :                : /*
                                 37                 :                :  * AVX2-optimized block checksum algorithm.
                                 38                 :                :  */
                                 39                 :                : #ifdef USE_AVX2_WITH_RUNTIME_CHECK
                                 40                 :                : pg_attribute_target("avx2")
                                 41                 :                : static uint32
   31 john.naylor@postgres       42                 :GNC     2678230 : pg_checksum_block_avx2(const PGChecksummablePage *page)
                                 43                 :                : {
                                 44                 :                : #include "storage/checksum_block_internal.h"
                                 45                 :                : }
                                 46                 :                : #endif                          /* USE_AVX2_WITH_RUNTIME_CHECK */
                                 47                 :                : 
                                 48                 :                : /*
                                 49                 :                :  * Choose the best available checksum implementation.
                                 50                 :                :  */
                                 51                 :                : static uint32
                                 52                 :          11101 : pg_checksum_choose(const PGChecksummablePage *page)
                                 53                 :                : {
                                 54                 :          11101 :     pg_checksum_block = pg_checksum_block_fallback;
                                 55                 :                : 
                                 56                 :                : #ifdef USE_AVX2_WITH_RUNTIME_CHECK
                                 57         [ +  - ]:          11101 :     if (x86_feature_available(PG_AVX2))
                                 58                 :          11101 :         pg_checksum_block = pg_checksum_block_avx2;
                                 59                 :                : #endif
                                 60                 :                : 
                                 61                 :          11101 :     return pg_checksum_block(page);
                                 62                 :                : }
                                 63                 :                : 
                                 64                 :                : static uint32 (*pg_checksum_block) (const PGChecksummablePage *page) = pg_checksum_choose;
        

Generated by: LCOV version 2.5.0-beta