install dpdk with collectd - dpdk

Trying to get collectd-5.12.0 work with DPDK 21.11
I followed the docs https://github.com/collectd/collectd/blob/main/docs/BUILD.dpdkstat.md to install collected with custom dpdk installation folder.
pkg-config --libs libdpdk
-Wl,--as-needed -L//lib64 -lrte_node -lrte_graph -lrte_flow_classify -lrte_pipeline -lrte_table -lrte_pdump -lrte_port -lrte_fib -lrte_ipsec -lrte_vhost -lrte_stack -lrte_security -lrte_sched -lrte_reorder -lrte_rib -lrte_dmadev -lrte_regexdev -lrte_rawdev -lrte_power -lrte_pcapng -lrte_member -lrte_lpm -lrte_latencystats -lrte_kni -lrte_jobstats -lrte_ip_frag -lrte_gso -lrte_gro -lrte_gpudev -lrte_eventdev -lrte_efd -lrte_distributor -lrte_cryptodev -lrte_compressdev -lrte_cfgfile -lrte_bpf -lrte_bitratestats -lrte_bbdev -lrte_acl -lrte_timer -lrte_hash -lrte_metrics -lrte_cmdline -lrte_pci -lrte_ethdev -lrte_meter -lrte_net -lrte_mbuf -lrte_mempool -lrte_rcu -lrte_ring -lrte_eal -lrte_telemetry -lrte_kvargs
./configure LIBDPDK_LDFLAGS="-L/root/dpdk-21.11/x86_64-native-linuxapp-gcc/lib64" LIBDPDK_CPPFLAGS="-I/root/dpdk-21.11/x86_64-native-linuxapp-gcc/include"
However, it's still not being picked up by collected.
Am I missing anything ?
Libraries:
libdpdk . . . . . . . no (symbol 'rte_eal_init' not found)
Modules:
dpdkevents. . . . . . no
dpdkstat . . . . . . no
dpdk_telemetry. . . . no

Worked after installing jansson-devel
Steps followed :
1. ./configure LIBDPDK_LDFLAGS="-L/usr/lib64/" LIBDPDK_CPPFLAGS="-I/root/dpdk-21.11/x86_64-native-linuxapp-gcc/include"
2. yum install jansson-devel
Modules:
dpdkevents. . . . . . yes
dpdkstat . . . . . . yes
dpdk_telemetry. . . . yes

Related

Trouble building ffmpeg with cuda for windows 32 with visual studio 2022

Here is my building process
I open mingw32 from the x64 Native Tools Command Prompt for VS 2022
then in the mingw32 shell:
# cd /
# ./c/Program\ Files/Microsoft\ Visual\ Studio/2022/Community/VC/Auxiliary/Build/vcvars32.bat
# cd ~
# pacman -Sy diffutils git make gcc yasm pkg-config --noconfirm
# git clone --depth 1 https://git.ffmpeg.org/ffmpeg.git ffmpeg
# git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git nv-codec-headers
# cd nv-codec-headers/
# make PREFIX=/usr/local
# make install PREFIX=/usr/local
# cd ..
# mkdir nv_sdk
# cp -r /c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.7/lib/Win32/* nv_sdk
# cp -r /c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.7/include/* nv_sdk
# export PATH="/c/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.32.31326/bin/Hostx86/x86/":$PATH
# export PATH="/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.7/bin/":$PATH
# ./configure --disable-everything --enable-decoder=h264 --enable-decoder=hevc --enable-cross-compile --disable-avdevice --disable-swresample --disable-postproc --disable-avfilter --target-os=mingw32 --enable-cuda-nvcc --enable-nonfree --toolchain=msvc --extra-cflags=-I../nv_sdk --extra-ldflags=" -m32 -L../nv_sdk" --enable-shared --shlibdir=SHARED_LIBS --arch=x86_32 --enable-runtime-cpudetect --enable-w32threads
# make -j8
# make install
first I have a bunch of warnings during the making looking like that:
libavutil/opt.c(1075): warning C4133: 'fonction' : types incompatibles - de 'AVPixelFormat *' à 'int *'
And finally the make install returns :
EXTERN_PREFIX="_" AR="lib.exe" NM="dumpbin.exe -symbols" ./compat/windows/makedef libavutil/libavutil.ver libavutil/adler32.o libavutil/aes.o libavutil/aes_ctr.o libavutil/audio_fifo.o libavutil/avsscanf.o libavutil/avstring.o libavutil/base64.o libavutil/blowfish.o libavutil/bprint.o libavutil/buffer.o libavutil/camellia.o libavutil/cast5.o libavutil/channel_layout.o libavutil/color_utils.o libavutil/cpu.o libavutil/crc.o libavutil/des.o libavutil/detection_bbox.o libavutil/dict.o libavutil/display.o libavutil/dovi_meta.o libavutil/downmix_info.o libavutil/encryption_info.o libavutil/error.o libavutil/eval.o libavutil/fifo.o libavutil/file.o libavutil/file_open.o libavutil/film_grain_params.o libavutil/fixed_dsp.o libavutil/float_dsp.o libavutil/frame.o libavutil/hash.o libavutil/hdr_dynamic_metadata.o libavutil/hdr_dynamic_vivid_metadata.o libavutil/hmac.o libavutil/hwcontext.o libavutil/hwcontext_d3d11va.o libavutil/hwcontext_dxva2.o libavutil/imgutils.o libavutil/integer.o libavutil/intmath.o libavutil/lfg.o libavutil/lls.o libavutil/log.o libavutil/log2_tab.o libavutil/lzo.o libavutil/mastering_display_metadata.o libavutil/mathematics.o libavutil/md5.o libavutil/mem.o libavutil/murmur3.o libavutil/opt.o libavutil/parseutils.o libavutil/pixdesc.o libavutil/pixelutils.o libavutil/random_seed.o libavutil/rational.o libavutil/rc4.o libavutil/reverse.o libavutil/ripemd.o libavutil/samplefmt.o libavutil/sha.o libavutil/sha512.o libavutil/slicethread.o libavutil/spherical.o libavutil/stereo3d.o libavutil/tea.o libavutil/threadmessage.o libavutil/time.o libavutil/timecode.o libavutil/tree.o libavutil/twofish.o libavutil/tx.o libavutil/tx_double.o libavutil/tx_float.o libavutil/tx_int32.o libavutil/utils.o libavutil/version.o libavutil/video_enc_params.o libavutil/x86/cpu.o libavutil/x86/cpuid.o libavutil/x86/fixed_dsp.o libavutil/x86/fixed_dsp_init.o libavutil/x86/float_dsp.o libavutil/x86/float_dsp_init.o libavutil/x86/imgutils.o libavutil/x86/imgutils_init.o libavutil/x86/lls.o libavutil/x86/lls_init.o libavutil/x86/tx_float.o libavutil/x86/tx_float_init.o libavutil/xga_font_data.o libavutil/xtea.o > libavutil/avutil-57.def
Could not create temporary library.
make: *** [ffbuild/library.mak:118: libavutil/avutil-57.dll] Error 1
What am I doing wrong ?
shall I install others packets from pacman?
I open mingw32 from the x64 Native Tools Command Prompt for VS 2022
maybe you should open it in X86 Native Tools Command Prompt for VS 2022

Fn::Sub with Bash parameter substitution

I have the following aws cloudformation template where i need to perform string manipulation inside the EC2 launch template section (where in URL is a cfn template parameter)-
UserData:
Fn::Base64: !Join
- ''
- - !Sub |
#!/bin/bash
set -o xtrace
.
.
git clone ${URL}
- |
CFNREPO=${URL/aws.*/aws-cfn.git}
git clone ${CFNREPO}
- !Sub |
GITHUBURL: ${githubURL}
.
.
Expected Output:
#!/bin/bash
set -o xtrace
.
.
git clone https://www.example.com/aws-s3.git
CFNREPO=https://www.example.com/aws-cfn.git
git clone https://www.example.com/aws-cfn.git
GITHUBURL: https://github.com/other-repo-url
.
.
Actual Output:
#!/bin/bash
set -o xtrace
.
.
git clone https://www.example.com/aws-s3.git
CFNREPO=${URL/aws.*/aws-cfn.git}
git clone ${CFNREPO}
GITHUBURL: https://github.com/other-repo-url
.
.
Referred - link , but the solution is not working as expected.
Your code is correct, at least from yaml perspective. This part:
CFNREPO=${URL/aws.*/aws-cfn.git}
git clone ${CFNREPO}
will be resolved when you run your code on an instance. This is not something that YAML or CloudFormation can do for you.

AWS : Bitnami : UNYSON : Cannot create temporary directory

I am facing the below issue-
WordPress 5.7.2 <> Tyring to install the required extension for UNYSON framework...and getting below error -
Install Extension Install theme compatible extensions
Downloading the "Shortcodes" extension...
Cannot create temporary directory:
Cannot create temporary directory: Return to the Extensions page
Tried - sudo chown -R bitnami:daemon /opt/bitnami/wordpress/wp-content/plugins
Still no luck...Please help.
I am able to fix the error using by adding the line.
define('WP_CONTENT_DIR', realpath(ABSPATH . './wp-content/'));
under the lines,
if ( ! defined( 'ABSPATH' ) ) { define( 'ABSPATH', __DIR__ . '/' );}
in wp-config.php.
Final code looks like this
if ( ! defined( 'ABSPATH' ) ) { define( 'ABSPATH', __DIR__ . '/' );}
define('WP_CONTENT_DIR', realpath(ABSPATH . './wp-content/'));
Let's reset the WordPress permissions:
sudo chown -R bitnami:daemon /opt/bitnami/wordpress
sudo chown -R bitnami:daemon /bitnami/wordpress/
sudo chmod -R g+w /opt/bitnami/wordpress
sudo chmod -R g+w /bitnami/wordpress/
sudo chmod 644 /bitnami/wordpress/wp-config.php
Can you install the WordPress' plugin now?
I solved the problem.
Just go to the linux's command line, access the config archive using:
vim /opt/bitnami/wordpress/wp-config.php
Then find this piece of code:
/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', __DIR__ . '/' );
}
Press ' i ' to insert a new line of code right below that one, and write:
define('WP_CONTENT_DIR',realpath(ABSPATH.'/wp-content/'));
As a result you must have:
/* That's all, stop editing! Happy publishing. */
/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', __DIR__ . '/' );
}
define('WP_CONTENT_DIR',realpath(ABSPATH.'/wp-content/'));
/**
* The base configuration for WordPress
*
Then just press 'ESC' to stop editing, then :W to save - or write - the code, and lastly :Q to quit the file.
Now you must be able to run the installation/ update successfully

Indy SNMP and C++ Builder XE3

I'm trying to use Indy SNMP component but is having problems
The following code
try
{
TIdSNMP* client = new TIdSNMP();
String host = "192.168.123.123";
String mib = "1.3.6.1.2.1.1.5.0";
Log(lInfo) << "Test simple SNMP call on server: " << host;
client->Host = host;
client->BoundIP = "192.168.123.1";
client->Community = "public";
client->ReceiveTimeout = 1000;
client->Query->Clear();
client->Query->PDUType = PDUGetRequest;
client->Query->MIBAdd(mib,"");
if (client->SendQuery())
//...
}
else
{
Log(lInfo) << "*** Query not sent *** ";
}
delete client;
}
catch (const Exception & ex)
{
Log(lInfo) << Mylog(L"ERROR [%s] ", ex.Message.c_str());
}
keep returning false on the SendQuery line, while using the snmpget client in a terminal gives proper result
>/Users/matsk:\> snmpget -v 2c -c public 192.168.123.123 1.3.6.1.2.1.1.5.0
SNMPv2-MIB::sysName.0 = STRING: Watchdog 15
where
SNMPv2-MIB::sysName.0 = STRING: Watchdog 15
is an expected return string from a temperature measuring device.
Or using version 1
>/Users/matsk:\> snmpget -v 1 -c public 192.168.123.123 1.3.6.1.2.1.1.5.0
SNMPv2-MIB::sysName.0 = STRING: Watchdog 15
I should add to the question that the device is connected to the local computer using a Ethernet -> USB dongle and is on a different 'subnet' than my regular internet connection. I'm not sure if that may add to Indy's behavior?
Doing a ipconfig /all gives for the relevant ethernet adapter, as suggested by Remy L.
Ethernet adapter Ethernet 2:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Linksys USB3GIGV1
Physical Address. . . . . . . . . : 94-10-3E-B7-D7-0A
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::bc9f:3659:9f91:2627%24(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.123.1(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
DHCPv6 IAID . . . . . . . . . . . : 412356670
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-21-70-32-91-D8-CB-8A-BC-E5-B
DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
fec0:0:0:ffff::2%1
fec0:0:0:ffff::3%1
NetBIOS over Tcpip. . . . . . . . : Enabled
from where I used BoundIP = 192.168.123.1
However, SendQuery() still returns false.
I copied some code from this post:
Indi TIdSNMP : How use SendQuery
Using Wireshark and a filter gives one line
63 47.723731 192.168.123.1 192.168.123.123 SNMP 82 get-request 1.3.6.1.2.1.1.5.0
Interestingly, when using snmpget I get
476 182.830210 192.168.123.1 192.168.123.123 SNMP 83 get-request 1.3.6.1.2.1.1.5.0
Only difference is that the Length record is being 83, instead of 82 for the request using Indy. Not sure if that helps figuring out whats going on?

Displaying Result and Expected values of an Assertion in CakePHP testing

Does anyone know if there is a way to force CakePHP TestSuite to view the Expected and Result values of an assertion when it fails? Typical PHPUnit tests are showing it by default in the output but not Cake's TestSuite (which uses PHPUnit). A side from that, when i debug a test case in NetBeans i get some kind of Socket Exception whenever i try to set a watch for a variable, and it only happens in CakePHP test cases, it works fine in evry other source file. Is there a solution for this aswell?
check out
http://www.dereuromark.de/2011/12/04/unit-testing-tips-for-2-0-and-phpunit/
basically, you can extend the TestCase class and make your own additional methods like
public function details($is, $expected) {
echo 'is:' . $is; echo '<br />';
echo 'expected: ' . $expected; ob_flush();
}
and call it internally or sth on fail.
or you just debug() everywhere.
Ok I somehow worked it out tho the solution will be wiped when u update the Cake Library files. You need to edit the file lib\Cake\TestSuite\Reporter\CakeHtmlReporter and change the method:
public function paintFail($message, $test)
{
$trace = $this->_getStackTrace($message);
$testName = get_class($test) . '(' . $test->getName() . ')';
echo "<li class='fail'>\n";
echo "<span>Failed</span>";
echo "<div class='msg'><pre>" . $this->_htmlEntities($message) . "</pre></div>\n";
echo "<div class='msg'>" . __d('cake_dev', 'Test case: %s', $testName) . "</div>\n";
echo "<div class='msg'>" . __d('cake_dev', 'Stack trace:') . '<br />' . $trace . "</div>\n";
echo "</li>\n";
}
to:
public function paintFail($message, $test) {
$trace = $this->_getStackTrace($message);
$testName = get_class($test) . '(' . $test->getName() . ')';
echo "<li class='fail'>\n";
echo "<span>Failed</span>";
echo "<div class='msg'><pre>" . $this->_htmlEntities($message->getComparisonFailure()->toString()) . "</pre></div>\n";
echo "<div class='msg'>" . __d('cake_dev', 'Test case: %s', $testName) . "</div>\n";
echo "<div class='msg'>" . __d('cake_dev', 'Stack trace:') . '<br />' . $trace . "</div>\n";
echo "</li>\n";
}
And this will output you something like this when the assertion fails:
Failed asserting that two arrays are equal.--- Expected
+++ Actual
## ##
Array (
- 0 => 'Crypto3DS'
- 1 => 'Zlib'
+ 1 => 'Crypto3DS'
+ 2 => 'Zlib'
)
Faster testing in Cake Yeppie :D