• jim warner's avatar
    pmap: fix printing bug associated with the '-x' option · b899c55d
    jim warner authored
    Ever since its introduction, the 'x' (extended format)
    option has employed strncmp to parse those smaps keys.
    Such an approach worked well as long as those prefixes
    were guaranteed to be unique. But, with the 4.3 kernel
    a new 'SwapPss' field was added to those within smaps.
    That triggered a 2nd match for the 'Swap' logic which,
    in turn, resulted in a duplicate output line of zeros.
    So this patch just trades strncmp for strcmp, avoiding
    potential future problems when /proc/$$/smaps evolves.
    . recent bug report
    . linux 4.3 kernel introduces SwapPss
    commit 8334b96221ff0dcbde4873d31eb4d84774ed8ed4
    . original pmap -x option introduction
    commit 380cc1e9Signed-off-by: jim warner's avatarJim Warner <james.warner@comcast.net>
pmap.c 30.8 KB