From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out2.migadu.com (out2.migadu.com [IPv6:2001:41d0:2:aacc::]) by sourceware.org (Postfix) with ESMTPS id B0B413858D35 for ; Thu, 5 Jan 2023 00:04:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B0B413858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.dev Message-ID: <4b4c115d-1ff5-75ab-bc52-c79e81a6f5ec@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1672877060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1L1Z5arXn/7odVoKBoK1pRTOtnmbL0z0TWo97n+/N1I=; b=g8eR8ntcJziJxwaeU1nulfLrgYbAP0E+AUjmkX4gNBAxyrUHoN+iMkgn3xvNUOE4an3ct+ FLAW+GcSZAO0XtCdC/WdSwoT6LhRySVBYTwotHFouMuBlVD6CPUuBXkBRPguBuEdTLnK1A P+Lk+DXRYYQdQXtmvqQn6w/8BxTZIU0= Date: Wed, 4 Jan 2023 16:04:17 -0800 MIME-Version: 1.0 Subject: glibc ifunc debug (was Re: glibc tunables to disable axv not updating memcpy) Content-Language: en-US To: Florian Weimer , Vineet Gupta via Libc-help References: <6d615a11-b863-1d76-e0ce-1f064cda06f1@linux.dev> <87bkoejnyq.fsf@oldenburg.str.redhat.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Vineet Gupta In-Reply-To: <87bkoejnyq.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS,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 List-Id: On 12/8/22 00:31, Florian Weimer wrote: > * Vineet Gupta via Libc-help: > >> Hi, >> >> I've been playing with x86_64 tunables to see how they are plumbed >> into ifunc machinery, but running into a something which I don't >> understand (this is glibc 2.35 so pretty recent). >> >> I'm disabling AVX and friends as: >> export >> GLIBC_TUNABLES=glibc.cpu.hwcaps=--SSSE3,-SSE4_2,AVX,-AVX2,-AVX512F,-AVX512VL >> >> >> A simple program which calls memcpy, seems to be calling >> __memmove_evex_unaligned_erms() despite my tunable disabling AVX512VL. >> >> | >> | main (argc=2, argv=0x7fffffffdce8) at test-mcpu.c:10 >> | 10 memcpy(dest, src, atoi(argv[1])); >> | (gdb) s >> | __memmove_evex_unaligned_erms () at >> ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:307 >> | 307 ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S >> >> >> glibc dependency on AVX512VL for the said routine/ >> >> | IFUNC_IMPL_ADD (array, i, memmove, >> | CPU_FEATURE_USABLE (AVX512VL), >> | __memmove_evex_unaligned_erms) >> | > This is for the test suite and the benchmarks. The production selector > is in sysdeps/x86_64/multiarch/ifunc-memmove.h. You should be able to > set a line-based breakpoint and single-step through it. Unfortunately gdb doesn't want to put a breakpoint in the ifunc header. I tried a -g3 -O2 build and excellent tips at [1] - Ubuntu 22.04 - gdb 12.1 | gdb elf/ld-linux-x86-64.so.2 | set exec-wrapper env LD_LIBRARY_PATH=.... | b _start | .. | b sysdeps/x86_64/multiarch/ifunc-memmove.h:48 | No source file named sysdeps/x86_64/multiarch/ifunc-memmove.h | b ../sysdeps/x86_64/multiarch/ifunc-memmove.h:48 It does seem to recognize other headers in x86_64. Do I need a newer gdb ? Also can't build glibc with -O0 anyways. Thx, -Vineet [1] https://sourceware.org/glibc/wiki/Debugging/Development_Debugging