profile
viewpoint
Andrey Skobtsov And42 Russia Moscow

And42/TranslatorApk 8

TranslatorApk

And42/KeyboardRemapper 1

An utility to remap keys on windows

And42/MVVM-Tools 1

Small library for handling common MVVM WPF cases

And42/AndroidTranslatorLib 0

Библиотека для работы с файлами android с возможностью перевода

And42/ClickHouse 0

ClickHouse is a free analytic DBMS for big data

And42/FunctionParser 0

Парсер математических выражений

And42/Il2CppDumper 0

Unity il2cpp reverse engineer

And42/LiquidCore 0

Node.js virtual machine for Android and iOS

release And42/TerrLauncherPackCreator

v1.17

released time in 2 days

created tagAnd42/TerrLauncherPackCreator

tagv1.17

created time in 2 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha ec768d972d432878200e1918f958bef2d89c49ad

Pack creator version changed: 1.16.1 > 1.17

view details

push time in 2 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha f72df888fb2c5369f11141bc62cad2bfbb115603

Added fonts file type

view details

And42

commit sha f9560049a8807b9548657c86dbc5f6fdaed88ada

PackStructureVersion changed: 10 > 11

view details

And42

commit sha b47759657c17daa4fba62165cc4e1100220330ff

Fixed font packs parsing

view details

And42

commit sha ee6a2bb7983db486a3051604c0261cf16820ea7e

Pack creator version changed: 1.16.1 > 1.17

view details

And42

commit sha ab983ba67b548375e0dc797aadeaa5ff198a3c75

Merge branch 'dev' into preview

view details

push time in 2 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha ee6a2bb7983db486a3051604c0261cf16820ea7e

Pack creator version changed: 1.16.1 > 1.17

view details

push time in 2 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha b47759657c17daa4fba62165cc4e1100220330ff

Fixed font packs parsing

view details

push time in 2 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha f9560049a8807b9548657c86dbc5f6fdaed88ada

PackStructureVersion changed: 10 > 11

view details

push time in 2 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha f72df888fb2c5369f11141bc62cad2bfbb115603

Added fonts file type

view details

push time in 2 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha befc2f5694d723b21331992f21d3d5e74e93845e

IsPreview = true in the preview branch

view details

push time in 5 days

create barnchAnd42/TerrLauncherPackCreator

branch : dev

created branch time in 5 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 75a440a39beb3bfc3e2cc238dec5f4c39f20cfab

IsPreview = false by default

view details

push time in 5 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 75a440a39beb3bfc3e2cc238dec5f4c39f20cfab

IsPreview = false by default

view details

push time in 5 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 672716a29d372cd8d8b2d4692968dea96d8145d3

Preview branch

view details

And42

commit sha 747096c95ee505d113c76ea47eedfdbc1f014359

Merge branch 'master' into preview

view details

And42

commit sha 973196dcfdbc0314202f6770d6418776acaad6e7

Merge branch 'master' into preview # Conflicts: # CommonLibrary/CommonConstants.cs

view details

And42

commit sha 8d2eadfa7037065492ef85f9b9ebd014d1204bba

Make preview preview again

view details

And42

commit sha a3a5995d01e1179059814eb6b0b54516195868c6

Merge branch 'master' into preview

view details

And42

commit sha 2803cf707f19728f06fc42d884dff6568c6f70e2

Merge branch 'master' into preview

view details

And42

commit sha b10b1242a6404c9cbcb81f17ea807912da0eb941

Ensure data dir exists before saving app settings

view details

And42

commit sha c87fe43a78e2686c84d5cd2f59707d8de253480f

Pack creator version changed: 1.14.4 > 1.14.5

view details

And42

commit sha 2434c28a2e748442c2fe5823c231fd42b1c81880

Updated README.md

view details

And42

commit sha 9290225085ee7842e44aa08f2b78665e54545674

Added an option to pass file extension to a temp file

view details

And42

commit sha a0bd1e5a585a696a532110b6f873cbf8bfbba8e7

Added webp support for icon/ authors and previews

view details

And42

commit sha f6b444021c1301ab0930a3ede0b97e44792ef186

Moved crash info window before handling exception to see messages in debug builds

view details

And42

commit sha 8c69459b99d5ac3a7d3438b0b209a6aba9929bac

PackStructureVersion changed: 9 > 10

view details

And42

commit sha c015e5115ef25c2837b0a0282a4e5e9bf00f53ce

Added window background switching depending on the version (Master/Preview)

view details

And42

commit sha 6fe3272898e375dc1cc103958755b8b04e795a88

Pack creator version changed: 1.14.5 > 1.15

view details

And42

commit sha 219117ecfb520b7737f971a09253c5a9e7a3bc32

Changed xaml formatting

view details

And42

commit sha cad719f96bcb1ba1a515a2cea936cd5361db49ae

Do not compress previously compressed previews

view details

And42

commit sha 12e395acb08da526d1339bf3f36c73b8d026eee6

Previews cropping (only non compressed)

view details

And42

commit sha 023a69a993f7a959cb0247946f4304a8c89f0115

Pack creator version changed: 1.15 > 1.16

view details

And42

commit sha 14651aee3821b9fe7c40d111ff921c907f8d630b

Changed preview window background

view details

push time in 5 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 9d20f9d07dfca2744eab16d4d3e25b15445adff6

Ensure data dir exists before saving app settings

view details

And42

commit sha aa15a1ee06815d08833e0c0b4c3f6efa8da101c4

Pack creator version changed: 1.14.4 > 1.14.5

view details

And42

commit sha 8a5472da0711f2477b44239e4694d914af67d4e7

Updated README.md

view details

And42

commit sha d8b20eefa388bc2ccdd7db0af1386dc70b6afb03

Added an option to pass file extension to a temp file

view details

And42

commit sha e1d74e1463c405f179960031e3fda2c4b66b1b33

Moved crash info window before handling exception to see messages in debug builds

view details

And42

commit sha 694bdbbdaacbf63f92463faf3cabf8b3f0411c22

Added window background switching depending on the version (Master/Preview)

view details

And42

commit sha b32b02959ac77d8924f27e37f4c28050dfc8111b

Pack creator version changed: 1.14.5 > 1.15

view details

And42

commit sha 9d990df27c6d21d7cba093ccd35de839bbdc4fbe

Changed xaml formatting

view details

And42

commit sha 8c3504d7faebd16dad04469de42da431bbf1a116

Pack creator version changed: 1.15 > 1.16

view details

And42

commit sha c2831e55f27d5240ebfe69df97e0bf30bb98ff3e

Changed preview window background

view details

And42

commit sha d801f32ff5f46de4d274f6012b3706b7a5de995d

Pack creator version changed: 1.16 > 1.16.1

view details

And42

commit sha 850de7e49ea2c6ec6577937c6f0c049d85152da5

Added webp support for icon/ authors and previews

view details

And42

commit sha 6eafa6e78bcfce65e0772a02e4bdd0e28f142b31

PackStructureVersion changed: 9 > 10

view details

And42

commit sha 92058405f8f7bafd50bb212cd9083faa906c9f33

Do not compress previously compressed previews

view details

And42

commit sha 31f632577a45fb16b019db733d73bf2c64af477d

Previews cropping (only non compressed)

view details

And42

commit sha c641a7d118c67c5095c53d403580cc70e21cca62

Merge branch 'preview' of github.com:And42/TerrLauncherPackCreator into preview

view details

push time in 5 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 850de7e49ea2c6ec6577937c6f0c049d85152da5

Added webp support for icon/ authors and previews

view details

And42

commit sha 6eafa6e78bcfce65e0772a02e4bdd0e28f142b31

PackStructureVersion changed: 9 > 10

view details

And42

commit sha 92058405f8f7bafd50bb212cd9083faa906c9f33

Do not compress previously compressed previews

view details

And42

commit sha 31f632577a45fb16b019db733d73bf2c64af477d

Previews cropping (only non compressed)

view details

push time in 5 days

created tagAnd42/TerrLauncherPackCreator

tagv1.16.1

created time in 10 days

release And42/TerrLauncherPackCreator

v1.16.1

released time in 10 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha d801f32ff5f46de4d274f6012b3706b7a5de995d

Pack creator version changed: 1.16 > 1.16.1

view details

push time in 10 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha a43fbdc0b65bc478121580257e66ed23c3433cc9

Pack creator version changed: 1.16 > 1.16.1

view details

push time in 10 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha c2831e55f27d5240ebfe69df97e0bf30bb98ff3e

Changed preview window background

view details

push time in 10 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 14651aee3821b9fe7c40d111ff921c907f8d630b

Changed preview window background

view details

push time in 10 days

startedele7enxxh/Android-Inline-Hook

started time in 12 days

created tagAnd42/TerrLauncherPackCreator

tagv1.16

created time in 12 days

release And42/TerrLauncherPackCreator

v1.16

released time in 12 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 8c3504d7faebd16dad04469de42da431bbf1a116

Pack creator version changed: 1.15 > 1.16

view details

push time in 12 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 023a69a993f7a959cb0247946f4304a8c89f0115

Pack creator version changed: 1.15 > 1.16

view details

push time in 12 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 9d990df27c6d21d7cba093ccd35de839bbdc4fbe

Changed xaml formatting

view details

push time in 13 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha cad719f96bcb1ba1a515a2cea936cd5361db49ae

Do not compress previously compressed previews

view details

And42

commit sha 12e395acb08da526d1339bf3f36c73b8d026eee6

Previews cropping (only non compressed)

view details

push time in 13 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 219117ecfb520b7737f971a09253c5a9e7a3bc32

Changed xaml formatting

view details

push time in 14 days

created tagAnd42/TerrLauncherPackCreator

tagv1.15

created time in 14 days

release And42/TerrLauncherPackCreator

v1.15

released time in 14 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha b32b02959ac77d8924f27e37f4c28050dfc8111b

Pack creator version changed: 1.14.5 > 1.15

view details

push time in 14 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 6fe3272898e375dc1cc103958755b8b04e795a88

Pack creator version changed: 1.14.5 > 1.15

view details

push time in 14 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 694bdbbdaacbf63f92463faf3cabf8b3f0411c22

Added window background switching depending on the version (Master/Preview)

view details

push time in 14 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha c015e5115ef25c2837b0a0282a4e5e9bf00f53ce

Added window background switching depending on the version (Master/Preview)

view details

push time in 14 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha d8b20eefa388bc2ccdd7db0af1386dc70b6afb03

Added an option to pass file extension to a temp file

view details

And42

commit sha e1d74e1463c405f179960031e3fda2c4b66b1b33

Moved crash info window before handling exception to see messages in debug builds

view details

push time in 14 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 9290225085ee7842e44aa08f2b78665e54545674

Added an option to pass file extension to a temp file

view details

And42

commit sha a0bd1e5a585a696a532110b6f873cbf8bfbba8e7

Added webp support for icon/ authors and previews

view details

And42

commit sha f6b444021c1301ab0930a3ede0b97e44792ef186

Moved crash info window before handling exception to see messages in debug builds

view details

And42

commit sha 8c69459b99d5ac3a7d3438b0b209a6aba9929bac

PackStructureVersion changed: 9 > 10

view details

push time in 14 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 8a5472da0711f2477b44239e4694d914af67d4e7

Updated README.md

view details

push time in 16 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 2434c28a2e748442c2fe5823c231fd42b1c81880

Updated README.md

view details

push time in 16 days

created tagAnd42/TerrLauncherPackCreator

tagv1.14.5

created time in 16 days

release And42/TerrLauncherPackCreator

v1.14.5

released time in 16 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 9d20f9d07dfca2744eab16d4d3e25b15445adff6

Ensure data dir exists before saving app settings

view details

And42

commit sha aa15a1ee06815d08833e0c0b4c3f6efa8da101c4

Pack creator version changed: 1.14.4 > 1.14.5

view details

push time in 16 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha b10b1242a6404c9cbcb81f17ea807912da0eb941

Ensure data dir exists before saving app settings

view details

And42

commit sha c87fe43a78e2686c84d5cd2f59707d8de253480f

Pack creator version changed: 1.14.4 > 1.14.5

view details

push time in 16 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 9ea5a04ec382ec2d03b618e021e48f3d6f089446

A separate install dir for preview

view details

And42

commit sha 122c09a77972c5a64dbf6758cacc884b88490975

Pack creator version changed: 1.14.3 > 1.14.4

view details

And42

commit sha b7556eec5f1f814a71b300e7ae2cf6cf472bd8ce

Pack updater version changed: 1.3 > 1.3.1

view details

And42

commit sha 2803cf707f19728f06fc42d884dff6568c6f70e2

Merge branch 'master' into preview

view details

push time in 16 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha b7556eec5f1f814a71b300e7ae2cf6cf472bd8ce

Pack updater version changed: 1.3 > 1.3.1

view details

push time in 16 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 9ea5a04ec382ec2d03b618e021e48f3d6f089446

A separate install dir for preview

view details

And42

commit sha 122c09a77972c5a64dbf6758cacc884b88490975

Pack creator version changed: 1.14.3 > 1.14.4

view details

push time in 16 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha c23a88b64d2271cd21ebdfcfc04fb20e2b873b8d

Pack creator version changed: 1.14.2 > 1.14.3

view details

And42

commit sha a3a5995d01e1179059814eb6b0b54516195868c6

Merge branch 'master' into preview

view details

push time in 16 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha c23a88b64d2271cd21ebdfcfc04fb20e2b873b8d

Pack creator version changed: 1.14.2 > 1.14.3

view details

push time in 16 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 8d2eadfa7037065492ef85f9b9ebd014d1204bba

Make preview preview again

view details

push time in 16 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha de3ace10e26cf868b3afb94829ae9418140c5857

Updated links

view details

And42

commit sha 4f83994c0bd29273799dc98c4369df328880e8d6

Pack creator version changed: 1.14.1 > 1.14.2

view details

And42

commit sha 973196dcfdbc0314202f6770d6418776acaad6e7

Merge branch 'master' into preview # Conflicts: # CommonLibrary/CommonConstants.cs

view details

push time in 16 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 4f83994c0bd29273799dc98c4369df328880e8d6

Pack creator version changed: 1.14.1 > 1.14.2

view details

push time in 16 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha de3ace10e26cf868b3afb94829ae9418140c5857

Updated links

view details

push time in 16 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha ea5b8f0925f30acbed7c8c991993ed8ca09ed78b

Pack creator version changed: 1.14 > 1.14.1

view details

And42

commit sha 747096c95ee505d113c76ea47eedfdbc1f014359

Merge branch 'master' into preview

view details

push time in 16 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha ea5b8f0925f30acbed7c8c991993ed8ca09ed78b

Pack creator version changed: 1.14 > 1.14.1

view details

push time in 16 days

create barnchAnd42/TerrLauncherPackCreator

branch : preview

created branch time in 16 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha afb159264f681e9679dd9305e61bed3c7d915ddd

Pack creator version changed: 1.13 > 1.14

view details

And42

commit sha 0ab2981551b61eb6910cff63616fb388ef0b43f4

Pack updater version changed: 1.2 > 1.3

view details

push time in 16 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha ff697f9ea4d41d80d8beecd28fe1a9b14e17e9ce

Updated app zip links

view details

push time in 16 days

startedJosePineiro/WebP-wrapper

started time in 18 days

created tagAnd42/TerrLauncherPackCreator

tagv1.13

created time in 24 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 6f6ea03ab5266ecee7138b181dd50ad5f9d5bc97

Version changed (1.12.1 > 1.13.0)

view details

push time in 24 days

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 2029829782ff969d70285b9d12f2b339682b853a

Disabled bonus packs creation as it is not ready on client

view details

push time in 24 days

created tagAnd42/TerrLauncherPackCreator

tagv1.12.1

created time in a month

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 2eb11e85703d6f6ce3ac04ca07d41d26c57e6c84

Fixed update logic

view details

And42

commit sha db5ae0b21bc844985b3a5ec0653a37f75e9bc64f

Version changed (1.12.0 > 1.12.1)

view details

push time in a month

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 61a3d0c8ea878604ec7c2de1d7149846e1e3bd63

Write app settings with indents

view details

push time in a month

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 0c6ade33f7955b8c1ce7ec2dfd8ec41a82881867

Button to restart sequence

view details

And42

commit sha b864375ca8e69556712fed1dfc2cc1c4885ea410

Version changed (1.11.1 > 1.12.0)

view details

push time in a month

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 450380f4a31660295a6294e0986606c09a199829

Save window size between launches

view details

push time in a month

push eventAnd42/SaveToGame

And42

commit sha 6b570e5ff4c43f157ee13bd3ba0a3c0c63979636

Check directory before deletion

view details

push time in a month

push eventAnd42/SaveToGame

And42

commit sha 558666916c63a9ea2a08d8a2e9ca81fa316b037f

Fix for multiple smali files (writing to the last one to not encounter methods limit)

view details

And42

commit sha 9351b0eb568be4dcbacace40fd12c38cc3cca54e

Fixed executable location handling

view details

push time in a month

startedmoscow-technologies/blockchain-voting

started time in a month

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 1e8f080fd92cffa39ecf6183511a728800d5a884

Added bonuses handling

view details

And42

commit sha e7701c9e26913a202b71f808321474e49501001d

Added a bit of null processing

view details

And42

commit sha 65824c5c97de73959f5d02350f026ffcbb63614b

Structure version updated to 9

view details

And42

commit sha e5c8fd8093b86e5a840b64d1c4d8d2b994ebdcf3

Switch expression

view details

And42

commit sha 3c5ecf156c1d8218a2e1e77c4f3b02d2346b8b67

Fixed error when loading existing packs (clearing tags in the main thread)

view details

push time in a month

startedtrigger-segfault/TConvert

started time in a month

push eventAnd42/TerrLauncherPackCreator

And42

commit sha e893d18b9de865a7402942c988097e10916ecde1

Neutral language changed (ru > en)

view details

And42

commit sha bcb52c1d67e6211261425f4d68db7ec41c34b0ef

Version changed (1.11 > 1.11.1)

view details

push time in a month

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 2855db64330bb311214490a41789ba6ee69899c1

Version changed (1.10 > 1.11)

view details

push time in a month

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 462e8364392e5fde88732adadc9bdd59a59ec7d6

Added animated buffs support

view details

And42

commit sha 7f34479ce54a5b75b80d15c6464fd2088541278a

Removed `terrariaStructureVersion` field

view details

push time in a month

push eventAnd42/TerrLauncherPackCreator

Andrey Skobtsov

commit sha 20c5d92cc56b1d13278eb1e7faf1a669c6102677

Create README.md

view details

push time in a month

created tagAnd42/TerrLauncherPackCreator

tagv1.10

created time in a month

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 98605da23c43846c02e22443f6ba3c0d28ee3070

Version changed (1.9.0 > 1.10.0)

view details

push time in a month

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 36cde494e194f1b89604569ad28eab97831b3d50

Added predefined tags

view details

push time in 2 months

startedSloy/android-dependency-injection-performance

started time in 2 months

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 4d696311b82423987af1a2b6822b506ff4d18279

Updated Costura xml

view details

push time in 2 months

push eventAnd42/TerrLauncherPackCreator

And42

commit sha b2e456c0044027bef831bbda8b29cf325e96a4f4

Version changed (1.8.0 > 1.9.0)

view details

push time in 2 months

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 9127dd940cbd3c1a83862af5b489672cea1cfdcc

Fixed crash when removing an item form a pack

view details

push time in 2 months

push eventAnd42/TerrLauncherPackCreator

And42

commit sha b19f7b10bd580fd2c052132b62e631715b0e5f96

Added animation in gui switch

view details

push time in 2 months

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 06f3012813228d2ec6a871681c7cdb325a08bd0b

Updated some dependencies

view details

And42

commit sha b7e71ea776e920907595f66b95043fce5403e830

Updated more dependencies

view details

push time in 2 months

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 3ecd1d5dd0983d56193c6ad7764657f11b4ead92

Added language switch

view details

push time in 2 months

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 4ea768f500134a25c1c2e9ba15f21e2ac300baf5

Reset font to a default one

view details

And42

commit sha 6d53f2928b984c85ad27e4876824b79ce007473b

Removed log and updated visuals

view details

And42

commit sha 3af6e366995ebb686153ff972de2633c13f8a18a

Added translations for authors window

view details

push time in 2 months

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 0d7fb3211fac2dcbacb6400cdad76b36307c59f9

Added animated item and npc textures

view details

And42

commit sha de9bb0cebb511cf3263e1967b7b046917ebb4397

Added AdonisUI

view details

And42

commit sha b1489aade24e9b4db8f2c8cd8acbf5719c7d6942

A bit of visual changes

view details

push time in 2 months

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 4be6be51d3f040be2677a61524b1f3125ee0aadd

Added compile time checks for handled file types

view details

push time in 2 months

pull request commentClickHouse/ClickHouse

Perf events metrics

Merged within pull request: https://github.com/ClickHouse/ClickHouse/pull/11226

And42

comment created time in 2 months

PR closed ClickHouse/ClickHouse

Perf events metrics can be tested doc-alert pr-feature

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category (leave one):

  • New Feature

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

  • Performance metrics via perf_events (Linux only)

Detailed description / Documentation draft: Using perf_events on Linux for performance metrics. All the metrics are query based. So, you can find them all within system.query_log table. Each metric opens a separate file descriptor.

Tasks:

  • [x] Come up with additional meaningful metrics based on the raw ones (so many raw ones, additional can be added in the future if needed)
  • [x] Remove metrics that already exist in other sources
  • [x] Probably lower number of file descriptors per query (~event groups could help?~ - could not). Overall, large number of file descriptors
  • [x] Add CAP_SYS_ADMIN check
  • [x] Rename metrics to some the user is familiar with. (e.g. perf stat names as advised here; camel case shortened now)
  • [x] Fix multiple PerfEventsCounters creation (overcomplicates the logic and not needed at the moment)
  • [x] Fix invalid counter measurements (removed counters)

Requirements

  • perf_events
  • CAP_SYS_ADMIN capability for an executable or perf_event_paranoid value lower than 3:
    • perf_event_paranoid >=1: CPU events info unavailable
    • perf_event_paranoid >=2: kernel profiling unavailable

Lifecycle

Query thread started > initializeProfileEvents called > Start measuring > Query thread stops > finalizeProfileEvents called > Increment counters + hold descriptors for the future events on the same thread

There are no intermediate counters' updates between Query thread started and Query thread stops as all the counters have an initial value of 0 unlike RUsageCounters and TasksStatsCounters and if an overflow happens nothing (as of now) can be done to handle it somehow properly. But an overflow is unlikely to happen as all events are stored as 64-bit unsigned integers and it will take 2^64 / 5000000000 / 60 / 60 / 24 / 365 ~= 117 years of a non-stop query on the 5 GHz CPU to overflow the fastest growing instructions counter.

Messages Handling

All the warnings (e.g. when there are issues while working with file descriptors) are written in LOG_WARNING.

Hardware Events

NB: each hardware event has two additional profile events associated: "<event>Running" and "<event>Enabled" that contain times when measurement was running on the PMU and enabled. This can be useful to get an idea of a measurement's precision as a CPU has a limited number of PMU's and it technically can't measure more than "number of PMU's" events at the same time.

Name Settings Alias Description
PerfCpuCycles cpu-cycles Total cycles. Be wary of what happens during CPU frequency scaling.
PerfInstructions instructions Retired instructions. Be careful, these can be affected by various issues, most notably hardware interrupt counts.
PerfCacheReferences cache-references Cache accesses. Usually this indicates Last Level Cache accesses but this may vary depending on your CPU. This may include prefetches and coherency messages; again this depends on the design of your CPU.
PerfCacheMisses cache-misses Cache misses. Usually this indicates Last Level Cache misses; this is intended to be used in con‐junction with the PERF_COUNT_HW_CACHE_REFERENCES event to calculate cache miss rates.
PerfBranchInstructions branch-instructions Retired branch instructions. Prior to Linux 2.6.35, this used the wrong event on AMD processors.
PerfBranchMisses branch-misses Mispredicted branch instructions.
PerfBusCycles bus-cycles Bus cycles, which can be different from total cycles.
PerfStalledCyclesFrontend stalled-cycles-frontend Stalled cycles during issue.
PerfStalledCyclesBackend stalled-cycles-backend Stalled cycles during retirement.
PerfRefCpuCycles ref-cpu-cycles Total cycles; not affected by CPU frequency scaling.

Software Events

Name Settings Alias Description
PerfCpuClock cpu-clock The CPU clock, a high-resolution per-CPU timer
PerfTaskClock task-clock A clock count specific to the task that is running
PerfPageFaults page-faults Number of page faults
PerfContextSwitches context-switches Number of context switches
PerfCpuMigrations cpu-migrations Number of times the process has migrated to a new CPU
PerfPageFaultsMin page-faults-min Number of minor page faults. These did not require disk I/O to handle
PerfPageFaultsMaj page-faults-maj Number of major page faults. These required disk I/O to handle
PerfAlignmentFaults alignment-faults Number of alignment faults. These happen when unaligned memory accesses happen; the kernel can handle these but it reduces performance. This happens only on some architectures (never on x86).
PerfEmulationFaults emulation-faults Number of emulation faults. The kernel sometimes traps on unimplemented instructions and emulates them for user space. This can negatively impact performance.

Computed Events (not possible in an "increment" manner)

Name Description
PERF_CUSTOM_INSTRUCTIONS_PER_CPU_CYCLE_SCALED PERF_COUNT_HW_INSTRUCTIONS / PERF_COUNT_HW_CPU_CYCLES
PERF_CUSTOM_INSTRUCTIONS_PER_CPU_CYCLE PERF_COUNT_HW_INSTRUCTIONS / PERF_COUNT_HW_REF_CPU_CYCLES
+722 -31

25 comments

8 changed files

And42

pr closed time in 2 months

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 3e48af3f7804af66fe60d9e03fa947adbe6e1820

Version changed (1.7.5 > 1.8.0)

view details

push time in 2 months

push eventAnd42/TerrLauncherPackCreator

And42

commit sha 1a13a005e65438183d4eaf958e61dd828dfd3206

Updated pack structure version: 3 > 4

view details

push time in 2 months

push eventAnd42/TerrLauncherPackCreator

And42

commit sha babbd2f00a8f786e1a53a9c74d34cceb1f9da9ef

Added translations handling

view details

push time in 2 months

Pull request review commentClickHouse/ClickHouse

Merge Perf events metrics #9545

 bool PerfEventsCounters::processThreadLocalChanges(const std::string & needed_ev     bool has_cap_sys_admin = hasLinuxCapability(CAP_SYS_ADMIN);     if (perf_event_paranoid >= 3 && !has_cap_sys_admin)     {-        LOG_WARNING(&Poco::Logger::get("PerfEventsCounters"), "Not enough permissions to record perf events: "+        LOG_WARNING(&Poco::Logger::get("PerfEvents"),+            "Not enough permissions to record perf events: "             "perf_event_paranoid = {} and CAP_SYS_ADMIN = 0",             perf_event_paranoid);         return false;     } -    // check file descriptors limit-    rlimit64 limits{};-    if (getrlimit64(RLIMIT_NOFILE, &limits))-    {-        LOG_WARNING(&Poco::Logger::get("PerfEventsCounters"), "Unable to get rlimit: {} ({})", strerror(errno),-                    errno);-        return false;-    }-    UInt64 maximum_open_descriptors = limits.rlim_cur;--    const size_t opened_descriptors = std::distance(-        std::filesystem::directory_iterator("/proc/self/fd"),-        std::filesystem::directory_iterator());--    UInt64 fd_count_afterwards = opened_descriptors + events_to_open.size();-    UInt64 threshold = static_cast<UInt64>(maximum_open_descriptors * FILE_DESCRIPTORS_THRESHOLD);-    if (fd_count_afterwards > threshold)-    {-        LOG_WARNING(&Poco::Logger::get("PerfEventsCounters"), "Can't measure perf events as the result number of file descriptors ({}) is more than the current threshold ({} = {} * {})",-            fd_count_afterwards, threshold, maximum_open_descriptors,-            FILE_DESCRIPTORS_THRESHOLD);-        return false;-    }--    // open descriptors for new events+    // Open descriptors for new events.+    // Theoretically, we can run out of file descriptors. Threads go up to 10k,+    // and there might be a dozen perf events per thread, so we're looking at+    // 100k open files. In practice, this is not likely -- perf events are+    // mostly used in performance tests or other kinds of testing, and the+    // number of threads stays below hundred.+    // We used to check the number of open files by enumerating /proc/self/fd,+    // but listing all open files before opening more files is obviously+    // quadratic, and quadraticity never ends well.     for (size_t i : events_to_open)     {         const PerfEventInfo & event_info = raw_events_info[i];         int & fd = thread_events_descriptors_holder.descriptors[i];         // disable by default to add as little extra time as possible         fd = openPerfEventDisabled(perf_event_paranoid, has_cap_sys_admin, event_info.event_type, event_info.event_config); -        if (fd == -1)+        if (fd == -1 && errno != ENOENT)         {-            LOG_WARNING(&Poco::Logger::get("PerfEventsCounters"), "Perf event is unsupported: {}"-                " (event_type={}, event_config={})",-                event_info.settings_name, event_info.event_type,-                event_info.event_config);+            // ENOENT means that the event is not supported, so we don't log it+            // for each thread. Other codes might signify an error.

A bit unclear what means "we don't log it for each thread" as now there is no logic that prevents it from logging each time on each thread an event can't be opened

akuzm

comment created time in 2 months

Pull request review commentClickHouse/ClickHouse

Merge Perf events metrics #9545

 void TasksStatsCounters::incrementProfileEvents(const ::taskstats & prev, const     profile_events.increment(ProfileEvents::OSReadBytes, safeDiff(prev.read_bytes, curr.read_bytes));     profile_events.increment(ProfileEvents::OSWriteBytes, safeDiff(prev.write_bytes, curr.write_bytes)); }++}++#endif++#if defined(__linux__) && !defined(ARCADIA_BUILD)++namespace DB+{++thread_local PerfEventsCounters current_thread_counters;++#define SOFTWARE_EVENT(PERF_NAME, LOCAL_NAME) \+    PerfEventInfo \+    { \+        .event_type = perf_type_id::PERF_TYPE_SOFTWARE, \+        .event_config = (PERF_NAME), \+        .profile_event = ProfileEvents::LOCAL_NAME, \+        .settings_name = #LOCAL_NAME \+    }++#define HARDWARE_EVENT(PERF_NAME, LOCAL_NAME) \+    PerfEventInfo \+    { \+        .event_type = perf_type_id::PERF_TYPE_HARDWARE, \+        .event_config = (PERF_NAME), \+        .profile_event = ProfileEvents::LOCAL_NAME, \+        .settings_name = #LOCAL_NAME \+    }++// descriptions' source: http://man7.org/linux/man-pages/man2/perf_event_open.2.html+static const PerfEventInfo raw_events_info[] = {+    HARDWARE_EVENT(PERF_COUNT_HW_CPU_CYCLES, PerfCpuCycles),+    HARDWARE_EVENT(PERF_COUNT_HW_INSTRUCTIONS, PerfInstructions),+    HARDWARE_EVENT(PERF_COUNT_HW_CACHE_REFERENCES, PerfCacheReferences),+    HARDWARE_EVENT(PERF_COUNT_HW_CACHE_MISSES, PerfCacheMisses),+    HARDWARE_EVENT(PERF_COUNT_HW_BRANCH_INSTRUCTIONS, PerfBranchInstructions),+    HARDWARE_EVENT(PERF_COUNT_HW_BRANCH_MISSES, PerfBranchMisses),+    HARDWARE_EVENT(PERF_COUNT_HW_BUS_CYCLES, PerfBusCycles),+    HARDWARE_EVENT(PERF_COUNT_HW_STALLED_CYCLES_FRONTEND, PerfStalledCyclesFrontend),+    HARDWARE_EVENT(PERF_COUNT_HW_STALLED_CYCLES_BACKEND, PerfStalledCyclesBackend),+    HARDWARE_EVENT(PERF_COUNT_HW_REF_CPU_CYCLES, PerfRefCpuCycles),+    // `cpu-clock` is a bit broken according to this: https://stackoverflow.com/a/56967896+    SOFTWARE_EVENT(PERF_COUNT_SW_CPU_CLOCK, PerfCpuClock),+    SOFTWARE_EVENT(PERF_COUNT_SW_TASK_CLOCK, PerfTaskClock),+    SOFTWARE_EVENT(PERF_COUNT_SW_CONTEXT_SWITCHES, PerfContextSwitches),+    SOFTWARE_EVENT(PERF_COUNT_SW_CPU_MIGRATIONS, PerfCpuMigrations),+    SOFTWARE_EVENT(PERF_COUNT_SW_ALIGNMENT_FAULTS, PerfAlignmentFaults),+    SOFTWARE_EVENT(PERF_COUNT_SW_EMULATION_FAULTS, PerfEmulationFaults)+};++#undef HARDWARE_EVENT+#undef SOFTWARE_EVENT++static int openPerfEvent(perf_event_attr *hw_event, pid_t pid, int cpu, int group_fd, UInt64 flags)+{+    return static_cast<int>(syscall(SYS_perf_event_open, hw_event, pid, cpu, group_fd, flags));+}++static int openPerfEventDisabled(Int32 perf_event_paranoid, bool has_cap_sys_admin, UInt32 perf_event_type, UInt64 perf_event_config)+{+    perf_event_attr pe{};+    pe.type = perf_event_type;+    pe.size = sizeof(struct perf_event_attr);+    pe.config = perf_event_config;+    // disable by default to add as little extra time as possible+    pe.disabled = 1;+    // can record kernel only when `perf_event_paranoid` <= 1 or have CAP_SYS_ADMIN+    pe.exclude_kernel = perf_event_paranoid >= 2 && !has_cap_sys_admin;+    pe.read_format = PERF_FORMAT_TOTAL_TIME_ENABLED | PERF_FORMAT_TOTAL_TIME_RUNNING;++    return openPerfEvent(&pe, /* measure the calling thread */ 0, /* on any cpu */ -1, -1, 0);+}++static void enablePerfEvent(int event_fd)+{+    if (ioctl(event_fd, PERF_EVENT_IOC_ENABLE, 0))+        LOG_WARNING(&Poco::Logger::get(__PRETTY_FUNCTION__), "Can't enable perf event with file descriptor {}", event_fd);+}++static void disablePerfEvent(int event_fd)+{+    if (ioctl(event_fd, PERF_EVENT_IOC_DISABLE, 0))+        LOG_WARNING(&Poco::Logger::get(__PRETTY_FUNCTION__), "Can't disable perf event with file descriptor {}"  , event_fd);+}++static void releasePerfEvent(int event_fd)+{+    if (close(event_fd))+    {+        LOG_WARNING(&Poco::Logger::get(__PRETTY_FUNCTION__), "Can't close perf event file descriptor {}: {} ({})", event_fd, errno, strerror(errno));+    }+}++static bool validatePerfEventDescriptor(int & fd)+{+    if (fcntl(fd, F_GETFL) != -1)+        return true;++    if (errno == EBADF)+    {+        LOG_WARNING(&Poco::Logger::get(__PRETTY_FUNCTION__), "Event descriptor {} was closed from the outside; reopening", fd);+    }+    else+    {+        LOG_WARNING(&Poco::Logger::get(__PRETTY_FUNCTION__), "Error while checking availability of event descriptor {}: {} ({})", fd, strerror(errno), errno);++        disablePerfEvent(fd);+        releasePerfEvent(fd);+    }++    fd = -1;+    return false;+}++bool PerfEventsCounters::processThreadLocalChanges(const std::string & needed_events_list)+{+    std::vector<size_t> valid_event_indices = eventIndicesFromString(needed_events_list);++    // find state changes (if there are any)+    bool old_state[NUMBER_OF_RAW_EVENTS];+    for (size_t i = 0; i < NUMBER_OF_RAW_EVENTS; ++i)+        old_state[i] = thread_events_descriptors_holder.descriptors[i] != -1;++    bool new_state[NUMBER_OF_RAW_EVENTS];+    std::fill_n(new_state, NUMBER_OF_RAW_EVENTS, false);+    for (size_t opened_index : valid_event_indices)+        new_state[opened_index] = true;++    std::vector<size_t> events_to_open;+    std::vector<size_t> events_to_release;+    for (size_t i = 0; i < NUMBER_OF_RAW_EVENTS; ++i)+    {+        bool old_one = old_state[i];+        bool new_one = new_state[i];++        if (old_one == new_one)+        {+            if (old_one+                && !validatePerfEventDescriptor(+                    thread_events_descriptors_holder.descriptors[i]))+            {+                events_to_open.push_back(i);+            }+            continue;+        }++        if (new_one)+            events_to_open.push_back(i);+        else+            events_to_release.push_back(i);+    }++    // release unused descriptors+    for (size_t i : events_to_release)+    {+        int & fd = thread_events_descriptors_holder.descriptors[i];+        disablePerfEvent(fd);+        releasePerfEvent(fd);+        fd = -1;+    }++    if (events_to_open.empty())+    {+        // FIXME remove this

fixme

akuzm

comment created time in 2 months

Pull request review commentClickHouse/ClickHouse

Merge Perf events metrics #9545

 void TasksStatsCounters::incrementProfileEvents(const ::taskstats & prev, const     profile_events.increment(ProfileEvents::OSReadBytes, safeDiff(prev.read_bytes, curr.read_bytes));     profile_events.increment(ProfileEvents::OSWriteBytes, safeDiff(prev.write_bytes, curr.write_bytes)); }++}++#endif++#if defined(__linux__) && !defined(ARCADIA_BUILD)++namespace DB+{++thread_local PerfEventsCounters current_thread_counters;++#define SOFTWARE_EVENT(PERF_NAME, LOCAL_NAME) \+    PerfEventInfo \+    { \+        .event_type = perf_type_id::PERF_TYPE_SOFTWARE, \+        .event_config = (PERF_NAME), \+        .profile_event = ProfileEvents::LOCAL_NAME, \+        .settings_name = #LOCAL_NAME \

Need to use "ALL_CAPS" or perf ("smth-smth") named as discussed before

akuzm

comment created time in 2 months

Pull request review commentClickHouse/ClickHouse

Merge Perf events metrics #9545

 void TasksStatsCounters::incrementProfileEvents(const ::taskstats & prev, const     profile_events.increment(ProfileEvents::OSReadBytes, safeDiff(prev.read_bytes, curr.read_bytes));     profile_events.increment(ProfileEvents::OSWriteBytes, safeDiff(prev.write_bytes, curr.write_bytes)); }++}++#endif++#if defined(__linux__) && !defined(ARCADIA_BUILD)++namespace DB+{++thread_local PerfEventsCounters current_thread_counters;++#define SOFTWARE_EVENT(PERF_NAME, LOCAL_NAME) \+    PerfEventInfo \+    { \+        .event_type = perf_type_id::PERF_TYPE_SOFTWARE, \+        .event_config = (PERF_NAME), \+        .profile_event = ProfileEvents::LOCAL_NAME, \+        .settings_name = #LOCAL_NAME \+    }++#define HARDWARE_EVENT(PERF_NAME, LOCAL_NAME) \+    PerfEventInfo \+    { \+        .event_type = perf_type_id::PERF_TYPE_HARDWARE, \+        .event_config = (PERF_NAME), \+        .profile_event = ProfileEvents::LOCAL_NAME, \+        .settings_name = #LOCAL_NAME \+    }++// descriptions' source: http://man7.org/linux/man-pages/man2/perf_event_open.2.html+static const PerfEventInfo raw_events_info[] = {+    HARDWARE_EVENT(PERF_COUNT_HW_CPU_CYCLES, PerfCpuCycles),+    HARDWARE_EVENT(PERF_COUNT_HW_INSTRUCTIONS, PerfInstructions),+    HARDWARE_EVENT(PERF_COUNT_HW_CACHE_REFERENCES, PerfCacheReferences),+    HARDWARE_EVENT(PERF_COUNT_HW_CACHE_MISSES, PerfCacheMisses),+    HARDWARE_EVENT(PERF_COUNT_HW_BRANCH_INSTRUCTIONS, PerfBranchInstructions),+    HARDWARE_EVENT(PERF_COUNT_HW_BRANCH_MISSES, PerfBranchMisses),+    HARDWARE_EVENT(PERF_COUNT_HW_BUS_CYCLES, PerfBusCycles),+    HARDWARE_EVENT(PERF_COUNT_HW_STALLED_CYCLES_FRONTEND, PerfStalledCyclesFrontend),+    HARDWARE_EVENT(PERF_COUNT_HW_STALLED_CYCLES_BACKEND, PerfStalledCyclesBackend),+    HARDWARE_EVENT(PERF_COUNT_HW_REF_CPU_CYCLES, PerfRefCpuCycles),+    // `cpu-clock` is a bit broken according to this: https://stackoverflow.com/a/56967896+    SOFTWARE_EVENT(PERF_COUNT_SW_CPU_CLOCK, PerfCpuClock),+    SOFTWARE_EVENT(PERF_COUNT_SW_TASK_CLOCK, PerfTaskClock),+    SOFTWARE_EVENT(PERF_COUNT_SW_CONTEXT_SWITCHES, PerfContextSwitches),+    SOFTWARE_EVENT(PERF_COUNT_SW_CPU_MIGRATIONS, PerfCpuMigrations),+    SOFTWARE_EVENT(PERF_COUNT_SW_ALIGNMENT_FAULTS, PerfAlignmentFaults),+    SOFTWARE_EVENT(PERF_COUNT_SW_EMULATION_FAULTS, PerfEmulationFaults)+};++#undef HARDWARE_EVENT+#undef SOFTWARE_EVENT++static int openPerfEvent(perf_event_attr *hw_event, pid_t pid, int cpu, int group_fd, UInt64 flags)+{+    return static_cast<int>(syscall(SYS_perf_event_open, hw_event, pid, cpu, group_fd, flags));+}++static int openPerfEventDisabled(Int32 perf_event_paranoid, bool has_cap_sys_admin, UInt32 perf_event_type, UInt64 perf_event_config)+{+    perf_event_attr pe{};+    pe.type = perf_event_type;+    pe.size = sizeof(struct perf_event_attr);+    pe.config = perf_event_config;+    // disable by default to add as little extra time as possible+    pe.disabled = 1;+    // can record kernel only when `perf_event_paranoid` <= 1 or have CAP_SYS_ADMIN+    pe.exclude_kernel = perf_event_paranoid >= 2 && !has_cap_sys_admin;+    pe.read_format = PERF_FORMAT_TOTAL_TIME_ENABLED | PERF_FORMAT_TOTAL_TIME_RUNNING;++    return openPerfEvent(&pe, /* measure the calling thread */ 0, /* on any cpu */ -1, -1, 0);+}++static void enablePerfEvent(int event_fd)+{+    if (ioctl(event_fd, PERF_EVENT_IOC_ENABLE, 0))+        LOG_WARNING(&Poco::Logger::get(__PRETTY_FUNCTION__), "Can't enable perf event with file descriptor {}", event_fd);+}++static void disablePerfEvent(int event_fd)+{+    if (ioctl(event_fd, PERF_EVENT_IOC_DISABLE, 0))+        LOG_WARNING(&Poco::Logger::get(__PRETTY_FUNCTION__), "Can't disable perf event with file descriptor {}"  , event_fd);+}++static void releasePerfEvent(int event_fd)+{+    if (close(event_fd))+    {+        LOG_WARNING(&Poco::Logger::get(__PRETTY_FUNCTION__), "Can't close perf event file descriptor {}: {} ({})", event_fd, errno, strerror(errno));+    }+}++static bool validatePerfEventDescriptor(int & fd)+{+    if (fcntl(fd, F_GETFL) != -1)+        return true;++    if (errno == EBADF)+    {+        LOG_WARNING(&Poco::Logger::get(__PRETTY_FUNCTION__), "Event descriptor {} was closed from the outside; reopening", fd);+    }+    else+    {+        LOG_WARNING(&Poco::Logger::get(__PRETTY_FUNCTION__), "Error while checking availability of event descriptor {}: {} ({})", fd, strerror(errno), errno);++        disablePerfEvent(fd);+        releasePerfEvent(fd);+    }++    fd = -1;+    return false;+}++bool PerfEventsCounters::processThreadLocalChanges(const std::string & needed_events_list)+{+    std::vector<size_t> valid_event_indices = eventIndicesFromString(needed_events_list);++    // find state changes (if there are any)+    bool old_state[NUMBER_OF_RAW_EVENTS];+    for (size_t i = 0; i < NUMBER_OF_RAW_EVENTS; ++i)+        old_state[i] = thread_events_descriptors_holder.descriptors[i] != -1;++    bool new_state[NUMBER_OF_RAW_EVENTS];+    std::fill_n(new_state, NUMBER_OF_RAW_EVENTS, false);+    for (size_t opened_index : valid_event_indices)+        new_state[opened_index] = true;++    std::vector<size_t> events_to_open;+    std::vector<size_t> events_to_release;+    for (size_t i = 0; i < NUMBER_OF_RAW_EVENTS; ++i)+    {+        bool old_one = old_state[i];+        bool new_one = new_state[i];++        if (old_one == new_one)+        {+            if (old_one+                && !validatePerfEventDescriptor(+                    thread_events_descriptors_holder.descriptors[i]))+            {+                events_to_open.push_back(i);+            }+            continue;+        }++        if (new_one)+            events_to_open.push_back(i);+        else+            events_to_release.push_back(i);+    }++    // release unused descriptors+    for (size_t i : events_to_release)+    {+        int & fd = thread_events_descriptors_holder.descriptors[i];+        disablePerfEvent(fd);+        releasePerfEvent(fd);+        fd = -1;+    }++    if (events_to_open.empty())+    {+        // FIXME remove this+        LOG_TRACE(&Poco::Logger::get("PerfEventsCounters"), "No perf events to open, list='{}'", needed_events_list);+        return true;+    }++    // check permissions+    // cat /proc/sys/kernel/perf_event_paranoid+    // -1: Allow use of (almost) all events by all users+    // >=0: Disallow raw tracepoint access by users without CAP_IOC_LOCK+    // >=1: Disallow CPU event access by users without CAP_SYS_ADMIN+    // >=2: Disallow kernel profiling by users without CAP_SYS_ADMIN+    // >=3: Disallow all event access by users without CAP_SYS_ADMIN+    Int32 perf_event_paranoid = 0;+    std::ifstream paranoid_file("/proc/sys/kernel/perf_event_paranoid");+    paranoid_file >> perf_event_paranoid;++    bool has_cap_sys_admin = hasLinuxCapability(CAP_SYS_ADMIN);+    if (perf_event_paranoid >= 3 && !has_cap_sys_admin)+    {+        LOG_WARNING(&Poco::Logger::get("PerfEventsCounters"), "Not enough permissions to record perf events: "+            "perf_event_paranoid = {} and CAP_SYS_ADMIN = 0",+            perf_event_paranoid);+        return false;+    }++    // check file descriptors limit+    rlimit64 limits{};+    if (getrlimit64(RLIMIT_NOFILE, &limits))+    {+        LOG_WARNING(&Poco::Logger::get("PerfEventsCounters"), "Unable to get rlimit: {} ({})", strerror(errno),+                    errno);+        return false;+    }+    UInt64 maximum_open_descriptors = limits.rlim_cur;++    const size_t opened_descriptors = std::distance(+        std::filesystem::directory_iterator("/proc/self/fd"),+        std::filesystem::directory_iterator());++    UInt64 fd_count_afterwards = opened_descriptors + events_to_open.size();+    UInt64 threshold = static_cast<UInt64>(maximum_open_descriptors * FILE_DESCRIPTORS_THRESHOLD);+    if (fd_count_afterwards > threshold)+    {+        LOG_WARNING(&Poco::Logger::get("PerfEventsCounters"), "Can't measure perf events as the result number of file descriptors ({}) is more than the current threshold ({} = {} * {})",+            fd_count_afterwards, threshold, maximum_open_descriptors,+            FILE_DESCRIPTORS_THRESHOLD);+        return false;+    }++    // open descriptors for new events+    for (size_t i : events_to_open)+    {+        const PerfEventInfo & event_info = raw_events_info[i];+        int & fd = thread_events_descriptors_holder.descriptors[i];+        // disable by default to add as little extra time as possible+        fd = openPerfEventDisabled(perf_event_paranoid, has_cap_sys_admin, event_info.event_type, event_info.event_config);++        if (fd == -1)+        {+            LOG_WARNING(&Poco::Logger::get("PerfEventsCounters"), "Perf event is unsupported: {}"+                " (event_type={}, event_config={})",+                event_info.settings_name, event_info.event_type,+                event_info.event_config);+        }+    }++    return true;+}++// Parse comma-separated list of event names. Empty or 'all' means all available+// events.+// TODO add validation to setting+std::vector<size_t> PerfEventsCounters::eventIndicesFromString(const std::string & events_list)

Comma separated list will be processed incorrectly if there are spaces around event names. For example, "cpu, instructions" will be handled as "cpu" and " instructions" events where " instructions" will not count as it has a space in the beginning. Seems important for me as comma is followed by a space in the most of the languages I know

akuzm

comment created time in 2 months

more