From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by sourceware.org (Postfix) with ESMTPS id 96BDD385414E for ; Wed, 29 Jun 2022 12:53:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 96BDD385414E Received: by mail-ej1-x634.google.com with SMTP id fi2so32350712ejb.9 for ; Wed, 29 Jun 2022 05:53:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JNkeNxgJKEkx6d9b0Cf8VbcgFEdV0ITCaS5ZDX65qOY=; b=Fankkg2qqQ77WWIDuNUxb3yhWL5T8JiyehEl+GUFjottIUkczxNHrgW+r+TPn3/uQ/ DvM4oNn99N3jvYrMrMe/O7EvYtvbVPAVPUkJdt+9N401DovjPeXUkwqD4U+H2o0rQBxn nWzOjg9lpl23ufDT/0ipShK2/h0sWdKhgLJpWvPS8iIJRdlWPScq0TX3G0n4mWptvHI5 c0s7VeXNQfGdZCeffaXz7SoQCOgCCb/U5IvecYrrknp1QpWMuBl8djEL/hBwVPXACBpB D0l/atd8jBV3xJcvD4vkl0RA2e9g8+qt0dESGus8Lhyr2j2DYqyrTIOGfc+ZGw01fx66 RkdQ== X-Gm-Message-State: AJIora8Hya4nGD9tfyEV7jurWiZ3dRmxjHpCAKuUucJ81tuXcDbbzJhw ujy4yEOWvdxjO1agBaOxfF7vm+fFdLsRTsDueWs= X-Google-Smtp-Source: AGRyM1uUYfjT8tnu74GZpVUzs8p/wH2P8eh+T1UK9R5/mzcIPScDOHWIyxhl65n0zTdTDbgFf3tHQU6iRQb2l/H/SN4= X-Received: by 2002:a17:907:9005:b0:718:391:45e with SMTP id ay5-20020a170907900500b007180391045emr3248329ejc.616.1656507192280; Wed, 29 Jun 2022 05:53:12 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Mohamed Atef Date: Wed, 29 Jun 2022 14:52:59 +0200 Message-ID: Subject: Re: libgompd output test To: Jakub Jelinek Cc: gcc@gcc.gnu.org X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jun 2022 12:53:16 -0000 On Wed, Jun 29, 2022 at 2:21 PM Jakub Jelinek wrote: > On Wed, Jun 29, 2022 at 06:45:51AM +0200, Mohamed Atef wrote: > > for this test case, > > > > 1.#include > > 2.#include > > 3.int > > 4.main() > > 5.{ > > 6. omp_set_num_threads (5); > > 7. #pragma omp parallel > > 8. { > > 9. int th = omp_get_thread_num (); > > 10. printf ("i am thread %d\n", th); > > 11. } > > 12. return 0; > > 13.} > > You can also use OMP_DISPLAY_ENV=verbose in the environment > to see how it is printed by the runtime. > > > Reading symbols from a.out... > > OMPD GDB support loaded > > Run 'ompd init' to start debugging > > (gdb) ompd init > > Temporary breakpoint 1 at 0x40115a: file pro.c, line 6. > > [Thread debugging using libthread_db enabled] > > Using host libthread_db library > "/lib/x86_64-linux-gnu/libthread_db.so.1". > > > > Temporary breakpoint 1, main () at pro.c:6 > > 6 omp_set_num_threads (5); > > Loaded OMPD lib successfully! > > Is the GDB OMPD patch available somewhere? > No, this is the GDB plugin. > > > (gdb) b 10 > > Breakpoint 2 at 0x401198: file pro.c, line 10. > > (gdb) c > > Continuing. > > [New Thread 0x7ffff7d45700 (LWP 116224)] > > [New Thread 0x7ffff7544700 (LWP 116225)] > > [New Thread 0x7ffff6d43700 (LWP 116226)] > > [Switching to Thread 0x7ffff7d45700 (LWP 116224)] > > > > Thread 2 "a.out" hit Breakpoint -14, gomp_thread_start > > (xdata=0x7fffffffd950) at ../../../gcc/libgomp/config/linux/sem.h:46 > > 46 *sem = value * SEM_INC; > > [New Thread 0x7ffff6542700 (LWP 116227)] > > [Switching to Thread 0x7ffff7544700 (LWP 116225)] > > > > Thread 3 "a.out" hit Breakpoint -14, gomp_thread_start > > (xdata=0x7fffffffd9d0) at ../../../gcc/libgomp/config/linux/sem.h:46 > > 46 *sem = value * SEM_INC; > > [Switching to Thread 0x7ffff6d43700 (LWP 116226)] > > > > Thread 4 "a.out" hit Breakpoint -14, gomp_thread_start > > (xdata=0x7fffffffda50) at ../../../gcc/libgomp/config/linux/sem.h:46 > > 46 *sem = value * SEM_INC; > > [Switching to Thread 0x7ffff6542700 (LWP 116227)] > > > > Thread 5 "a.out" hit Breakpoint -14, gomp_thread_start > > (xdata=0x7fffffffdad0) at ../../../gcc/libgomp/config/linux/sem.h:46 > > 46 *sem = value * SEM_INC; > > > > Thread 5 "a.out" hit Breakpoint 2, main._omp_fn.0 () at pro.c:10 > > 10 printf ("i am thread %d\n", th); > > (gdb) bt > > #0 main._omp_fn.0 () at pro.c:10 > > #1 0x00007ffff7f9dd8e in gomp_thread_start (xdata=) at > > ../../../gcc/libgomp/team.c:131 > > #2 0x00007ffff7f48609 in start_thread (arg=) at > > pthread_create.c:477 > > #3 0x00007ffff7e6d133 in clone () at > > ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 > > (gdb) ompd icv > > Initialized ICV map successfully for checking OMP API values. > > ICV Name Scope Value > > =============================================================== > > cancel var address_space 0 > > max task priority var address_space 0 > > stack size var address_space 0 > > debug var address_space 0 > > OMP_DEBUG address_space enabled > > display affinity var address_space 0 > > affinity format var address_space level %L > thread > > %i affinity %A > > This ought to be IMHO printed as a string literal, so "level %L thread %i > affinity %A" > > > affinity format len var address_space 0 > > wait policy var address_space 4294967295 > > num teams var address_space 0 > > teams thread limit var address_space 0 > > spin count var address_space 300000 > > num proc var address_space 8 > > throttled spin count var address_space 100 > > managed threads var address_space 5 > > And also, it would be nice if it was clear which ICVs are GCC > implementation > specific and which are standard (the spin count vars are non-standard). > Also, the names of ICVs in the standard are with hyphens, so perhaps print > cancel-var, max-task-priority-var etc.? > OK, I will fix it in the next patch. > > Jakub > >