-
-
Notifications
You must be signed in to change notification settings - Fork 53
This change hopes to provide a better alignement of pkeyread with other #203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
444ffec
to
5f73b2a
Compare
rebased with current changes. |
perf/Makefile
Outdated
dh.pem dhx.pem dsa.pem ec.pem rsa.pem x25519.pem \ | ||
dh.der dhx.der dsa.der ec.der rsa.der x25519.der |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are really confusing names for aliases of pkeyread. Would you please consider something like pkeyread-dh-pem
?
Also on Windows this will not be practical IMO. So perhaps just keeping the key type and formats as arguments and handling this within the perftesting script somehow would make more sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New version of diff uses suggested naming convention. The whole point of this exercise is to unify command line options handling of performance tools. In my opinion the effort here definitely pays off because then we can construct performance testing scripts without too much thinking which arguments to pass to each tool. It shortens debugging time spent to get tests running.
My plan for windows is to use COPY
instead of symlink.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about this approach. IMO it is not scalable. @openssl/otc what are others opinions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it could be made scalable using a make variable to hold the list of possibilities.
Perhaps using some string manipulation functions to get things correct and only have one copy of the list.
eee3bcd
to
3eb94e6
Compare
perf/Makefile
Outdated
@@ -49,3 +57,39 @@ regen_key_samples: | |||
|
|||
pkeyread: pkeyread.c keys.h libperf.a | |||
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o pkeyread pkeyread.c -lperf -lcrypto | |||
|
|||
pkeyread-dh-pem: pkeyread |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about converting this lot into:
pkeyread-%: pkeyread
$(LN) -s pkeyread $@
or if the suggestion about using a variable to hold them, use that on the left of the colon.
perf/Makefile
Outdated
rm -f libperf.a *.o randbytes handshake sslnew newrawkey rsasign x509storeissuer providerdoall rwlocks pkeyread evp_fetch | ||
rm -f libperf.a *.o randbytes handshake sslnew newrawkey rsasign x509storeissuer providerdoall rwlocks pkeyread evp_fetch \ | ||
pkeyread-dh-pem pkeyread-dhx-pem pkeyread-dsa-pem pkeyread-ec-pem pkeyread-rsa-pem pkeyread-x25519-pem \ | ||
pkeyread-dh-der pkeyread-dhx-der pkeyread-dsa-der pkeyread-ec-der pkeyread-rsa-der pkeyread-x25519-der |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider defining a make variable to avoid duplication of all of these names?
perf/pkeyread.c
Outdated
@@ -217,6 +218,103 @@ static void usage(char * const argv[]) | |||
} while (*format_name != NULL); | |||
} | |||
|
|||
static void implicit_report_result(char * const argv[], int terse) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style nit: no space after the *
perf/pkeyread.c
Outdated
get_avcalltime()); | ||
} | ||
|
||
static int implicit_main(int argc, char * const argv[]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style nit: no space after the *
3eb94e6
to
6ef81f3
Compare
new version brings all @paulidale suggestions in. |
perf/Makefile
Outdated
@@ -49,3 +57,6 @@ regen_key_samples: | |||
|
|||
pkeyread: pkeyread.c keys.h libperf.a | |||
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o pkeyread pkeyread.c -lperf -lcrypto | |||
|
|||
$(PKEYREAD_SYMLINKS) pkeyread-%: pkeyread |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop the pkeyread-%
it's not required
perf/Makefile
Outdated
@@ -13,6 +19,8 @@ LDFLAGS += -L$(TARGET_OSSL_LIBRARY_PATH) -L. | |||
# For setting RUNPATH on built executables uncomment this: | |||
# LDFLAGS += -Wl,-rpath,$(TARGET_OSSL_LIBRARY_PATH) | |||
|
|||
LN=/bin/ln |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This precludes the makefile working on non-unix like targets. I'm not sure that's a good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the easiest hack for platforms with no symlinks we can do is just LN=copy
.
The current Makefile
as-is assumes unix-like environment anyway. more work is required to build tools on windows.
given we can not agree on wether implicit arguments approach is acceptable for rwlocks tests here: #205 I'm going to extend run-perf.sh script we discuss here in #207 so it will be able to deal with explicit arguments. I feel this approach to be easier for everyone.
performance tools we have. The pkeyread enables as to evaluate speed of reading various keys in der/pem formats. This requires user to specifi desired key and format on command line. This makes pkeyread different to other tools which seem to have a common set of options: ./tool_name --terse 2 command line above executes tool tool_name running test using 2 threads with terse output. The idea of this change is to provide implicit mode for pkeyread where key and format is determined from command name. For example to run evaulation for rsa key in pem format using 2 threads one runs tool: ./rsa.pem 2 The tool for rsa essentially becames a symlink to pkeyread binary. This should help us to create us more simple shell scripts to run performacne test. For example to run all tests for pem keys we can do something like this in shell for perf_tool in *.pem ; do ./$perf_tool --terse 2 ; done
6ef81f3
to
af71db5
Compare
of implicit arguments (symlinks to tools). The approach is discussed in those two PRs: openssl#205 openssl#203
@vdukhovni version of |
performance tools we have. The pkeyread enables as to evaluate speed of reading various keys in der/pem formats. This requires user to specifi desired key and format on command line. This makes pkeyread different to other tools which seem to have a common set of options:
./tool_name --terse 2
command line above executes tool tool_name running test using 2 threads with terse output. The idea of this change is to provide implicit mode for pkeyread where key and format is determined from command name. For example to run evaulation for rsa key in pem format using 2 threads one runs tool:
./rsa.pem 2
The tool for rsa essentially becames a symlink to pkeyread binary.
This should help us to create us more simple shell scripts to run performacne test. For example to run all tests for pem keys we can do something like this in shell
for perf_tool in *.pem ; do
./$perf_tool --terse 2 ;
done