@@ -279,208 +279,6 @@ The guidelines are:
279
279
[ log-create-link] :
280
280
https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/Logging/Create.interface.yaml
281
281
282
- ## Adding application specific error YAML
283
-
284
- - This document captures steps for adding application specific error YAML files
285
- and generating local elog-errors.hpp header file for application use.
286
- - Should cater for continuous integration (CI) build, bitbake image build, and
287
- local repository build.
288
-
289
- ### Continuous Integration (CI) build
290
-
291
- - Make is called on the repository that is modified.
292
- - Dependent packages are pulled based on the dependency list specified in the
293
- configure.ac script.
294
-
295
- #### Recipe build
296
-
297
- - Native recipes copy error YAML files to shared location.
298
- - phosphor-logging builds elog-errors.hpp by parsing the error YAML files from
299
- the shared location.
300
-
301
- #### Local repository build
302
-
303
- - Copies local error YAML files to the shared location in SDK
304
- - Make generates elog-errors.hpp by parsing the error YAML files from the shared
305
- location.
306
-
307
- #### Makefile changes
308
-
309
- [ Reference] ( https://github.com/openbmc/openpower-debug-collector/blob/master/Makefile.am )
310
-
311
- ##### Export error YAML to shared location
312
-
313
- ##### Modify Makefile.am to export newly added error YAML to shared location
314
-
315
- ``` make
316
- yamldir = ${datadir}/phosphor-dbus-yaml/yaml
317
- nobase_yaml_DATA = \
318
- org/open_power/Host.errors.yaml
319
- ```
320
-
321
- ###### Generate elog-errors.hpp using elog parser from SDK location
322
-
323
- - Add a conditional check "GEN_ERRORS"
324
- - Disable the check for recipe bitbake image build
325
- - Enable it for local repository build
326
- - If "GEN_ERRORS" is enabled, build generates elog-errors.hpp header file.
327
-
328
- ``` make
329
- # Generate phosphor-logging/elog-errors.hpp
330
- if GEN_ERRORS
331
- ELOG_MAKO ?= elog-gen-template.mako.hpp
332
- ELOG_DIR ?= ${OECORE_NATIVE_SYSROOT}${datadir}/phosphor-logging/elog
333
- ELOG_GEN_DIR ?= ${ELOG_DIR}/tools/
334
- ELOG_MAKO_DIR ?= ${ELOG_DIR}/tools/phosphor-logging/templates/
335
- YAML_DIR ?= ${OECORE_NATIVE_SYSROOT}${datadir}/phosphor-dbus-yaml/yaml
336
- phosphor-logging/elog-errors.hpp :
337
- @mkdir -p ${YAML_DIR}/org/open_power/
338
- @cp ${top_srcdir}/org/open_power/Host.errors.yaml \
339
- ${YAML_DIR}/org/open_power/Host.errors.yaml
340
- @mkdir -p `dirname $@`
341
- @chmod 777 $(ELOG_GEN_DIR)/elog-gen.py
342
- $(AM_V_at)$(PYTHON) $(ELOG_GEN_DIR)/elog-gen.py -y ${YAML_DIR} \
343
- -t ${ELOG_MAKO_DIR} -m ${ELOG_MAKO} -o $@
344
- endif
345
- ```
346
-
347
- ###### Update BUILT_SOURCES
348
-
349
- - Append elog-errors.hpp to BUILT_SOURCES list and put it in conditional check
350
- GEN_ERRORS so that the elog-errors.hpp is generated only during local
351
- repository build.
352
-
353
- ``` make
354
- if GEN_ERRORS
355
- nobase_nodist_include_HEADERS += \
356
- phosphor-logging/elog-errors.hpp
357
- endif
358
- if GEN_ERRORS
359
- BUILT_SOURCES += phosphor-logging/elog-errors.hpp
360
- endif
361
- ```
362
-
363
- ###### Conditional check for native build
364
-
365
- - As the same Makefile is used both for recipe image build and native recipe
366
- build, add a conditional to ensure that only installation of error yaml files
367
- happens during native build. It is not required to build repository during
368
- native build.
369
-
370
- ``` make
371
- if !INSTALL_ERROR_YAML
372
- endif
373
- ```
374
-
375
- #### Autotools changes
376
-
377
- [ Reference] ( https://github.com/openbmc/openpower-debug-collector/blob/master/configure.ac )
378
-
379
- ##### Add option(argument) to enable/disable installing error yaml file
380
-
381
- - Install error yaml option(argument) is enabled for native recipe build and
382
- disabled for bitbake build.
383
-
384
- - When install error yaml option is disabled do not check for target specific
385
- packages in autotools configure script.
386
-
387
- ###### Add option(argument) to install error yaml files
388
-
389
- ``` autoconf
390
- AC_ARG_ENABLE([install_error_yaml],
391
- AS_HELP_STRING([--enable-install_error_yaml],
392
- [Enable installing error yaml file]),[], [install_error_yaml=no])
393
- AM_CONDITIONAL([INSTALL_ERROR_YAML],
394
- [test "x$enable_install_error_yaml" = "xyes"])
395
- AS_IF([test "x$enable_install_error_yaml" != "xyes"], [
396
- ..
397
- ..
398
- ])
399
- ```
400
-
401
- ###### Add option(argument) to enable/disable generating elog-errors header file
402
-
403
- ``` autoconf
404
- AC_ARG_ENABLE([gen_errors],
405
- AS_HELP_STRING([--enable-gen_errors], [Enable elog-errors.hpp generation ]),
406
- [],[gen_errors=yes])
407
- AM_CONDITIONAL([GEN_ERRORS], [test "x$enable_gen_errors" != "xno"])
408
- ```
409
-
410
- #### Recipe changes
411
-
412
- [ Reference] ( https://github.com/openbmc/openbmc/blob/master/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/debug/openpower-debug-collector.bb )
413
-
414
- ##### Extend recipe for native and nativesdk
415
-
416
- - Extend the recipe for native and native SDK builds
417
-
418
- ``` BitBake
419
- BBCLASSEXTEND += "native nativesdk"
420
- ```
421
-
422
- ###### Remove dependencies for native and native SDK build
423
-
424
- - Native recipe caters only for copying error yaml files to shared location.
425
- - For native and native SDK build remove dependency on packages that recipe
426
- build depends
427
-
428
- ###### Remove dependency on phosphor-logging for native build
429
-
430
- ``` BitBake
431
- DEPENDS_remove_class-native = "phosphor-logging"
432
- ```
433
-
434
- ###### Remove dependency on phosphor-logging for native SDK build
435
-
436
- ``` BitBake
437
- DEPENDS_remove_class-nativesdk = "phosphor-logging"
438
- ```
439
-
440
- ###### Add install_error_yaml argument during native build
441
-
442
- - Add package config to enable/disable install_error_yaml feature.
443
-
444
- ###### Add package config to enable/disable install_error_yaml feature
445
-
446
- ``` BitBake
447
- PACKAGECONFIG ??= "install_error_yaml"
448
- PACKAGECONFIG[install_error_yaml] = " \
449
- --enable-install_error_yaml, \
450
- --disable-install_error_yaml, ,\
451
- "
452
- ```
453
-
454
- ###### Enable install_error_yaml check for native build
455
-
456
- ``` BitBake
457
- PACKAGECONFIG_add_class-native = "install_error_yaml"
458
- PACKAGECONFIG_add_class-nativesdk = "install_error_yaml"
459
- ```
460
-
461
- ###### Disable install_error_yaml during target build
462
-
463
- ``` BitBake
464
- PACKAGECONFIG_remove_class-target = "install_error_yaml"
465
- ```
466
-
467
- ###### Disable generating elog-errors.hpp for bitbake build
468
-
469
- - Disable gen_errors argument for bitbake image build as the application uses
470
- the elog-errors.hpp generated by phosphor-logging
471
- - Argument is enabled by default for local repository build in the configure
472
- script of the local repository.
473
-
474
- ``` BitBake
475
- XTRA_OECONF += "--disable-gen_errors"
476
- ```
477
-
478
- #### Local build
479
-
480
- - During local build use --prefix=/usr for the configure script.
481
-
482
- [ Reference] ( https://github.com/openbmc/openpower-debug-collector/blob/master/README.md )
483
-
484
282
## Event Log Extensions
485
283
486
284
The extension concept is a way to allow code that creates other formats of error
0 commit comments