Skip to content

UCS/PROFILE: added ucx env to profiling output - #8918

Merged
yosefe merged 1 commit into
openucx:masterfrom
roiedanino:profiling/add-full-cmdline-and-env
Jun 1, 2023
Merged

yosefe merged 1 commit into
openucx:masterfrom
roiedanino:profiling/add-full-cmdline-and-env

Conversation

@roiedanino

Copy link
Copy Markdown
Contributor

What

In the profiling output file: printing the full command line and adding env variables

Why ?

That way we can know exactly what was executed when analyzing the .prof file.

@roiedanino
roiedanino force-pushed the profiling/add-full-cmdline-and-env branch 2 times, most recently from f2dacd8 to 427f786 Compare March 8, 2023 13:30
Comment thread src/ucs/profile/profile_defs.h Outdated
uint32_t version; /**< File format version */
char ucs_path[1024]; /**< UCX library path*/
char cmdline[1024]; /**< Command line */
char env_variables[1024]; /**< UCX environment variables*/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. it means older parser could not read profile from newer version and vice versa?
    need to try make it compatible and update file format version accordingly
  2. better allocate exactly as much space as needed since the list of env vars could be long/short in different cases

Comment thread src/ucs/profile/profile.c Outdated
/* write header */
memset(&header, 0, sizeof(header));
ucs_read_file(header.cmdline, sizeof(header.cmdline), 1, "/proc/self/cmdline");
strncpy(header.cmdline, ucs_get_process_cmdline(), sizeof(header.cmdline) - 1);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use ucs_strncpy_safe

@roiedanino
roiedanino force-pushed the profiling/add-full-cmdline-and-env branch from 427f786 to 7d3d114 Compare March 12, 2023 17:08
@roiedanino roiedanino added the WIP-DNM Work in progress / Do not review label Mar 12, 2023
@roiedanino roiedanino self-assigned this Mar 12, 2023
@roiedanino
roiedanino marked this pull request as draft March 12, 2023 17:10
@roiedanino
roiedanino force-pushed the profiling/add-full-cmdline-and-env branch from 7d3d114 to f20c1ec Compare March 13, 2023 15:23
Comment thread src/ucs/profile/profile_defs.h Resolved
Comment thread src/tools/profile/read_profile.c Resolved
Comment thread src/ucs/profile/profile_defs.h Resolved
Comment thread src/ucs/profile/profile_defs.h Resolved
Comment thread src/ucs/config/parser.c Resolved
Comment thread src/ucs/config/parser.c Resolved
Comment thread src/ucs/config/parser.h Resolved
Comment thread src/ucs/profile/profile.c Resolved
Comment thread src/ucs/profile/profile_defs.h Resolved
Comment thread src/ucs/profile/profile_defs.h Resolved
@roiedanino
roiedanino force-pushed the profiling/add-full-cmdline-and-env branch 3 times, most recently from cfa9ab5 to 8eba5d0 Compare March 15, 2023 11:53
@roiedanino
roiedanino marked this pull request as ready for review March 15, 2023 12:04
@roiedanino
roiedanino force-pushed the profiling/add-full-cmdline-and-env branch 16 times, most recently from 5abc2fd to 6f1c1ea Compare March 22, 2023 11:18
@roiedanino
roiedanino force-pushed the profiling/add-full-cmdline-and-env branch from 6f1c1ea to 84acecc Compare March 22, 2023 13:24
Comment thread src/tools/profile/read_profile.c Resolved
Comment thread src/tools/profile/read_profile.c Resolved
Comment thread src/tools/profile/read_profile.c Resolved
Comment thread src/tools/profile/read_profile.c Resolved
Comment thread src/tools/profile/read_profile.c Resolved
Comment thread src/ucs/profile/profile_defs.h Resolved
Comment thread src/ucs/profile/profile_defs.h Resolved
Comment thread src/ucs/profile/profile_defs.h Outdated
Comment on lines +99 to +101
ucs_profile_block_t locations_block; /**< Size and offset of locations*/
ucs_profile_block_t threads_block; /**< Size and offset of threads*/
ucs_profile_block_t env_block; /**< Size and offset of environment variables string*/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ucs_profile_block_header_t locations;
ucs_profile_block_header_t threads;
ucs_profile_block_header_t env_vars;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unresolved

Comment thread src/ucs/profile/profile_defs.h Resolved
Comment thread src/ucs/profile/profile_defs.h Resolved
@roiedanino roiedanino added WIP-DNM Work in progress / Do not review and removed WIP-DNM Work in progress / Do not review labels May 1, 2023
@yosefe

yosefe commented May 7, 2023

Copy link
Copy Markdown
Member

@roiedanino pls fix the commit title

@roiedanino
roiedanino force-pushed the profiling/add-full-cmdline-and-env branch 2 times, most recently from 4112430 to 91dd1df Compare May 10, 2023 09:14
@roiedanino
roiedanino force-pushed the profiling/add-full-cmdline-and-env branch 2 times, most recently from 0cdd030 to 081b9c4 Compare May 16, 2023 09:37
Comment thread src/tools/profile/read_profile.c Resolved
Comment thread src/tools/profile/read_profile.c Resolved
Comment thread src/ucs/config/parser.c Resolved
Comment thread src/ucs/config/parser.c Resolved
Comment thread src/ucs/profile/profile.c Resolved
Comment thread src/tools/profile/read_profile.c Resolved
Comment thread src/tools/profile/read_profile.c Resolved
Comment thread src/ucs/profile/profile.c Resolved
Comment thread src/ucs/profile/profile_defs.h Resolved
Comment thread src/ucs/profile/profile_defs.h Resolved
@roiedanino
roiedanino force-pushed the profiling/add-full-cmdline-and-env branch 3 times, most recently from aa1f5b8 to d79d118 Compare May 22, 2023 06:07

@yosefe yosefe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls check clang-format output after every PR update

Comment thread src/tools/profile/Makefile.am Resolved
Comment thread src/tools/profile/read_profile.c Resolved
Comment thread src/tools/profile/read_profile.c Resolved
Comment thread src/tools/profile/read_profile.c Resolved
Comment thread src/tools/profile/read_profile.c Resolved
Comment thread test/gtest/ucs/test_profile.cc Resolved
Comment thread test/gtest/ucs/test_profile.cc Resolved
Comment thread test/gtest/ucs/test_profile.cc Resolved
Comment thread test/gtest/ucs/test_profile.cc Resolved
Comment thread src/ucs/profile/profile.c Resolved
@roiedanino
roiedanino force-pushed the profiling/add-full-cmdline-and-env branch 2 times, most recently from ee374e7 to 509d1af Compare May 23, 2023 09:05
Comment thread src/ucs/profile/profile.c Resolved
Comment thread src/ucs/profile/profile.c Resolved
Comment thread test/gtest/ucs/test_profile.cc Resolved
Comment thread test/gtest/ucs/test_profile.cc Resolved
Comment thread test/gtest/ucs/test_profile.cc Resolved
@roiedanino
roiedanino force-pushed the profiling/add-full-cmdline-and-env branch 4 times, most recently from 93c8706 to 3839142 Compare May 24, 2023 14:23
Comment thread src/tools/profile/read_profile.c Resolved
Comment thread src/tools/profile/read_profile.c Resolved
Comment thread src/tools/profile/read_profile.c Resolved
Comment thread src/ucs/profile/profile_defs.h Resolved

@yosefe yosefe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls check clang-format, some code style issues are relevant

Comment thread src/tools/profile/read_profile.c Resolved
Comment thread src/tools/profile/read_profile.c Resolved
Comment thread src/tools/profile/read_profile.c Resolved
Comment thread src/tools/profile/read_profile.c Resolved
Comment thread src/ucs/profile/profile_defs.h Resolved
Comment thread src/tools/profile/read_profile.c Resolved
Comment thread src/ucs/profile/profile.c Resolved
Comment thread src/ucs/profile/profile.c Resolved
Comment thread src/ucs/profile/profile_defs.h Resolved
@roiedanino
roiedanino force-pushed the profiling/add-full-cmdline-and-env branch 2 times, most recently from 0c9672e to eb0c981 Compare May 31, 2023 10:00

@yosefe yosefe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls squash

…e structure

TEST/GTEST/UCS/TEST_PROFILE: updated tests according to the changes in the file structure

TEST/GTEST/UCS/TEST_PROFILE: added support for env from cmdline
@roiedanino
roiedanino force-pushed the profiling/add-full-cmdline-and-env branch from eb0c981 to 5bf3df8 Compare May 31, 2023 15:06
@yosefe
yosefe merged commit ddf924d into openucx:master Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants