From 17b55587df144ef13bcca6be72163d97b3be4eec Mon Sep 17 00:00:00 2001 From: Ralf Schmelter Date: Fri, 24 Nov 2023 13:20:58 +0100 Subject: [PATCH 1/2] SapMachine #1540: Fix incorrect handling of invalid values in vitals extremas --- src/hotspot/os/linux/vitals_linux_oswrapper.cpp | 4 ++-- src/hotspot/share/vitals/vitals.cpp | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hotspot/os/linux/vitals_linux_oswrapper.cpp b/src/hotspot/os/linux/vitals_linux_oswrapper.cpp index cb331c30700..edff0ec368f 100644 --- a/src/hotspot/os/linux/vitals_linux_oswrapper.cpp +++ b/src/hotspot/os/linux/vitals_linux_oswrapper.cpp @@ -84,8 +84,8 @@ class ProcFile { return false; } - size_t bytes_read = ::fread(_buf, 1, bufsize, f); - _buf[bufsize - 1] = '\0'; + size_t bytes_read = ::fread(_buf, 1, bufsize - 1, f); + _buf[bytes_read] = '\0'; ::fclose(f); diff --git a/src/hotspot/share/vitals/vitals.cpp b/src/hotspot/share/vitals/vitals.cpp index 7dd83e0a660..3860e0929c8 100644 --- a/src/hotspot/share/vitals/vitals.cpp +++ b/src/hotspot/share/vitals/vitals.cpp @@ -875,6 +875,8 @@ class SampleTables: public CHeapObj { bool should_log = (column->extremum() == MAX) && (sample->value(idx) > extremum_sample->value(idx)); should_log |= (column->extremum() == MIN) && (sample->value(idx) < extremum_sample->value(idx)); + should_log &= sample->value(idx) != INVALID_VALUE; + should_log |= extremum_sample->value(idx) == INVALID_VALUE; if (should_log) { Sample* last_extremum_sample = _last_extremum_samples.sample_at(idx); From d856242e1c75380872239d3942e9ecd1493d4327 Mon Sep 17 00:00:00 2001 From: Johannes Bechberger Date: Fri, 24 Nov 2023 14:04:03 +0100 Subject: [PATCH 2/2] SapMachine #1544: Run wiki update task regularly --- .github/actions/update-wiki/action.yml | 24 ++++++++++++++++++++++++ .github/workflows/wiki.yml | 18 ++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 .github/actions/update-wiki/action.yml create mode 100644 .github/workflows/wiki.yml diff --git a/.github/actions/update-wiki/action.yml b/.github/actions/update-wiki/action.yml new file mode 100644 index 00000000000..3ed23d5f6ee --- /dev/null +++ b/.github/actions/update-wiki/action.yml @@ -0,0 +1,24 @@ +name: Update Wiki + +description: | + This action updates the wiki with the latest blog posts. + +runs: + using: composite + steps: + - name: Update Wiki + run: | + git clone https://github.com/SAP/SapMachine.wiki.git + cd SapMachine.wiki + pip3 install feedparser + python3 scripts/update_blogs.py update > ../out + cat ../out + if grep -q changed ../out; then + git commit -a -m "Update blog posts" + git push + echo "Blog post list updated" + else + echo "No updates" + fi + working-directory: . + shell: bash diff --git a/.github/workflows/wiki.yml b/.github/workflows/wiki.yml new file mode 100644 index 00000000000..0d5a5b76c3b --- /dev/null +++ b/.github/workflows/wiki.yml @@ -0,0 +1,18 @@ +# Runs update-wiki update actions every day at 20:00 UTC + +name: 'Wiki Update' + +on: + workflow_dispatch: + schedule: + - cron: '0 20 * * *' + +jobs: + wiki: + runs-on: ubuntu-latest + steps: + - name: 'Checkout the JDK source' + uses: actions/checkout@v4 + - name: 'Update Wiki' + uses: ./.github/actions/update-wiki +