You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2020/09/08 17:19:10 UTC

[GitHub] [mynewt-core] nkaje opened a new pull request #2372: crypto_test: get stats in milliseconds

nkaje opened a new pull request #2372:
URL: https://github.com/apache/mynewt-core/pull/2372


   Along with ticks, print in milliseconds as well.
   
   Signed-off-by: Naveen Kaje <na...@juul.com>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-core] nkaje merged pull request #2372: crypto_test: get stats in milliseconds

Posted by GitBox <gi...@apache.org>.
nkaje merged pull request #2372:
URL: https://github.com/apache/mynewt-core/pull/2372


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-core] kasjer commented on a change in pull request #2372: crypto_test: get stats in milliseconds

Posted by GitBox <gi...@apache.org>.
kasjer commented on a change in pull request #2372:
URL: https://github.com/apache/mynewt-core/pull/2372#discussion_r485177824



##########
File path: apps/crypto_test/src/main.c
##########
@@ -286,7 +288,10 @@ run_benchmark(char *name, block_encrypt_func_t encfn, void *data, uint8_t iter)
             }
         }
     }
-    printf("done in %lu ticks\n", os_time_get() - t);
+    e = os_time_get() - t;
+    ret = os_time_ticks_to_ms(e, &ms);
+    assert(ret == 0);
+    printf("done in %lu ticks / %lu ms\n", e, ms);

Review comment:
       When **RISCV** (unlike ARM) gcc compiler is used, **uint32_t** is not `unsigned long int` but just `unsigned int`.
   Usage of `"%lu"` will lead to warnings there.
   I would suggest to use **PRIu32** or cast to avoid future warning fixes.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2372: crypto_test: get stats in milliseconds

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on pull request #2372:
URL: https://github.com/apache/mynewt-core/pull/2372#issuecomment-689036635


   
   <!-- style-bot -->
   
   ## Style check summary
   
   #### No suggestions at this time!
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2372: crypto_test: get stats in milliseconds

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot removed a comment on pull request #2372:
URL: https://github.com/apache/mynewt-core/pull/2372#issuecomment-689036635


   
   <!-- style-bot -->
   
   ## Style check summary
   
   #### No suggestions at this time!
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-core] nkaje commented on a change in pull request #2372: crypto_test: get stats in milliseconds

Posted by GitBox <gi...@apache.org>.
nkaje commented on a change in pull request #2372:
URL: https://github.com/apache/mynewt-core/pull/2372#discussion_r485564267



##########
File path: apps/crypto_test/src/main.c
##########
@@ -286,7 +288,10 @@ run_benchmark(char *name, block_encrypt_func_t encfn, void *data, uint8_t iter)
             }
         }
     }
-    printf("done in %lu ticks\n", os_time_get() - t);
+    e = os_time_get() - t;
+    ret = os_time_ticks_to_ms(e, &ms);
+    assert(ret == 0);
+    printf("done in %lu ticks / %lu ms\n", e, ms);

Review comment:
       done.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2372: crypto_test: get stats in milliseconds

Posted by GitBox <gi...@apache.org>.
apache-mynewt-bot commented on pull request #2372:
URL: https://github.com/apache/mynewt-core/pull/2372#issuecomment-689540467


   
   <!-- style-bot -->
   
   ## Style check summary
   
   ### Our coding style is [here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
   #### apps/crypto_test/src/main.c
   <details>
   
   ```diff
   @@ -199,7 +199,7 @@
            sz = crypto_encrypt_custom(crypto, algo, mode, key, keylen, ivp,
                    inbuf, outbuf, asksz);
            if (sz == asksz && memcmp(outbuf, vector->cipher, sz) == 0) {
   -            printf("ok, sz=%"PRIu32"\n", sz);
   +            printf("ok, sz=%" PRIu32 "\n", sz);
            } else {
                printf("fail\n");
            }
   @@ -224,7 +224,7 @@
            sz = crypto_decrypt_custom(crypto, algo, mode, key, keylen, ivp,
                    inbuf, outbuf, asksz);
            if (sz == asksz && memcmp(outbuf, vector->plain, sz) == 0) {
   -            printf("ok, sz=%"PRIu32"\n", sz);
   +            printf("ok, sz=%" PRIu32 "\n", sz);
            } else {
                printf("fail\n");
            }
   @@ -291,7 +291,7 @@
        e = os_time_get() - t;
        ret = os_time_ticks_to_ms(e, &ms);
        assert(ret == 0);
   -    printf("done in %"PRIu32" ticks / %"PRIu32" ms\n", e, ms);
   +    printf("done in %" PRIu32 " ticks / %" PRIu32 " ms\n", e, ms);
    }
    
    static void
   @@ -326,7 +326,7 @@
        e = os_time_get() - t;
        ret = os_time_ticks_to_ms(e, &ms);
        assert(ret == 0);
   -    printf("done in %"PRIu32" ticks / %"PRIu32" ms\n", e, ms);
   +    printf("done in %" PRIu32 " ticks / %" PRIu32 " ms\n", e, ms);
    }
    
    static void
   @@ -361,7 +361,7 @@
        e = os_time_get() - t;
        ret = os_time_ticks_to_ms(e, &ms);
        assert(ret == 0);
   -    printf("done in %"PRIu32" ticks / %"PRIu32" ms\n", e, ms);
   +    printf("done in %" PRIu32 " ticks / %" PRIu32 " ms\n", e, ms);
    }
    #endif /* MYNEWT_VAL(CRYPTOTEST_BENCHMARK) */
    
   ```
   
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [mynewt-core] nkaje commented on pull request #2372: crypto_test: get stats in milliseconds

Posted by GitBox <gi...@apache.org>.
nkaje commented on pull request #2372:
URL: https://github.com/apache/mynewt-core/pull/2372#issuecomment-689022097


   Test output
   ```
   === Test vectors ===
   AES-128-ECB enc
           vector 0: ok, sz=16
           vector 1: ok, sz=16
           vector 2: ok, sz=16
           vector 3: ok, sz=16
   AES-128-ECB dec
           vector 0: ok, sz=16
           vector 1: ok, sz=16
           vector 2: ok, sz=16
           vector 3: ok, sz=16
   AES-128-CBC enc
           vector 0: ok, sz=16
           vector 1: ok, sz=16
           vector 2: ok, sz=16
           vector 3: ok, sz=16
   AES-128-CBC dec
           vector 0: ok, sz=16
           vector 1: ok, sz=16
           vector 2: ok, sz=16
           vector 3: ok, sz=16
   AES-128-CTR enc
           vector 0: ok, sz=16
           vector 1: ok, sz=16
           vector 2: ok, sz=8
           vector 3: ok, sz=16
   AES-128-CTR dec
           vector 0: ok, sz=16
           vector 1: ok, sz=16
           vector 2: ok, sz=8
           vector 3: ok, sz=16
   
   === In-place encrypt/decrypt ===
   AES-128-ECB enc: ok
   AES-128-ECB dec: ok
   AES-128-CBC enc: ok
   AES-128-CBC dec: ok
   AES-128-CTR enc: ok
   AES-128-CTR dec: ok
   
   === iovec encrypt/decrypt ===
   iov AES-128-ECB enc: ok
   iov AES-128-ECB dec: ok
   iov AES-128-CBC enc: ok
   iov AES-128-CBC dec: ok
   iov AES-128-CTR enc: ok
   iov AES-128-CTR dec: ok
   
   === Benchmarks - iteration 1 ===
   CRYPTO - running 30 iterations of 4096 block encrypt... done in 30 ticks / 234 ms
   MBEDTLS - running 30 iterations of 4096 block encrypt... done in 62 ticks / 484 ms
   TINYCRYPT - running 30 iterations of 4096 block encrypt... done in 358 ticks / 2796 ms
   
   === Benchmarks - iteration 2 ===
   CRYPTO - running 30 iterations of 4096 block encrypt... done in 30 ticks / 234 ms
   MBEDTLS - running 30 iterations of 4096 block encrypt... done in 62 ticks / 484 ms
   TINYCRYPT - running 30 iterations of 4096 block encrypt... done in 358 ticks / 2796 ms
   
   === Benchmarks - iteration 3 ===
   CRYPTO - running 30 iterations of 4096 block encrypt... done in 30 ticks / 234 ms
   MBEDTLS - running 30 iterations of 4096 block encrypt... done in 62 ticks / 484 ms
   TINYCRYPT - running 30 iterations of 4096 block encrypt... done in 358 ticks / 2796 ms
   
   === CRYPTO benchmarks ===
   AES-128-CBC - running 50 iterations of 4096 block encrypt... done in 54 ticks / 421 ms
   AES-128-CTR - running 50 iterations of 4096 block encrypt... done in 54 ticks / 421 ms
   
   === Concurrency [8 tasks] ===
   task0 [0 fails / 256 ok] done
   task1 [0 fails / 256 ok] done
   task2 [0 fails / 256 ok] done
   task3 [0 fails / 256 ok] done
   task4 [0 fails / 256 ok] done
   task5 [0 fails / 256 ok] done
   task6 [0 fails / 256 ok] done
   task7 [0 fails / 256 ok] done
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org