Current File : //proc/self/root/usr/src/linux-headers-6.8.0-59/scripts/dtc/of_unittest_expect
#!/usr/bin/perl
# SPDX-License-Identifier: GPL-2.0
#
# Copyright 2020, 2022 Sony Corporation
#
# Author: Frank Rowand

# This program is meant to be an aid to reading the verbose output of
# on the console log that results from executing the Linux kernel
# devicetree unittest (drivers/of/unitest.c).

$VUFX = "230211a";

use strict 'refs';
use strict subs;

use Getopt::Long;
use Text::Wrap;

# strip off everything before final "/"
(undef, $script_name) = split(/^.*\//, $0);

# following /usr/include/sysexits.h
$EX_OK=0;
$EX_USAGE=64;


#______________________________________________________________________________
sub compare {
	my ($expect, $got) = @_;
	my $expect_next;
	my $expect_next_lit;
	my $got_next;
	my $type;

	while ($expect) {

		($expect_next, $type) = split(/<</, $expect);
		($type) = split(/>>/, $type);
		$expect =~ s/^.*?>>//;	# '?' is non-greedy, minimal match

		# literal, ignore all metacharacters when used in a regex
		$expect_next_lit = quotemeta($expect_next);

		$got_next = $got;
		$got_next =~ s/^($expect_next_lit).*/\1/;
		$got       =~ s/^$expect_next_lit//;

		if ($expect_next ne $got_next) {
			return 0;
		}

		if ($type eq "int") {
			if ($got =~ /^[+-]*[0-9]+/) {
				$got =~ s/^[+-]*[0-9]+//;
			} else {
				return 0;
			}
		} elsif ($type eq "hex") {
			if ($got =~ /^(0x)*[0-9a-f]+/) {
				$got =~ s/^(0x)*[0-9a-f]+//;
			} else {
				return 0;
			}
		} elsif ($type eq "all") {
			return 1;
		} elsif ($type eq "") {
			if ($expect_next ne $got_next) {
				return 0;
			} else {
				return 1;
			}
		} else {
			$internal_err++;
			print "** ERROR: special pattern not recognized: <<$type>>, CONSOLE_LOG line: $.\n";
			return 0;
		}

	}

	# should not get here
	$internal_err++;
	print "** ERROR: $script_name internal error, at end of compare(), CONSOLE_LOG line: $.\n";

	return 0;
}


#______________________________________________________________________________
sub usage {

# ***** when editing, be careful to not put tabs in the string printed:

	print STDERR
"
usage:

  $script_name CONSOLE_LOG

     -h                print program usage
    --help             print program usage
    --hide-expect      suppress output of EXPECTed lines
    --line-num         report line number of CONSOLE_LOG
    --no-expect-stats  do not report EXPECT statistics
    --no-strip-ts      do not strip leading console timestamps
    --verbose          do not suppress EXPECT begin and end lines
    --version          print program version and exit


  Process a console log for EXPECTed test related messages to either
  highlight expected devicetree unittest related messages or suppress
  the messages.  Leading console timestamps will be stripped.

  Various unittests may trigger kernel messages from outside the
  unittest code.  The unittest annotates that it expects the message
  to occur with an 'EXPECT \\ : text' (begin) before triggering the
  message, and an 'EXPECT / : text' (end) after triggering the message.

  If an expected message does not occur, that will be reported.

  For each expected message, the 'EXPECT \\ : text' (begin) and
  'EXPECT / : text' (end), 'text' will contain the message text.

  If 'EXPECT \\' (begin) and 'EXPECT /' (end) lines do not contain
  matching 'text', that will be reported.

  If EXPECT lines are nested, 'EXPECT /' (end) lines must be in the
  reverse order of the corresponding 'EXPECT \\' (begin) lines.

  'EXPECT \\ : text' (begin) and 'EXPECT / : text' (end) lines can
  contain special patterns in 'text':

     <<int>> matches: [+-]*[0-9]+
     <<hex>> matches: (0x)*[0-9a-f]+
     <<all>> matches: anything to end of line

  'EXPECT \\' (begin) and 'EXPECT /' (end) lines are suppressed.

  A prefix is added to every line of output:

    'ok ' Line matches an enclosing EXPECT begin/end pair

    '** ' Line reports $script_name warning or error

    '-> ' Line reports start or end of the unittests

    '>> ' Line reports a unittest test FAIL

    '   ' Lines that are not otherwise prefixed

  Issues detected in CONSOLE_LOG are reported to STDOUT, not to STDERR.

  Known Issues:

    --line-num causes the CONSOLE_LOG line number to be printed in 4 columns.
       If CONSOLE_LOG contains more than 9999 lines then more columns will be
       used to report the line number for lines greater than 9999 (eg for
       lines 10000 - 99999, 5 columns will be used).
";

	return {};
}

#______________________________________________________________________________
#______________________________________________________________________________

if (!GetOptions(
	"h"               => \$help,
	"help"            => \$help,
	"hide-expect"     => \$hide_expect,
	"line-num"        => \$print_line_num,
	"no-expect-stats" => \$no_expect_stats,
	"no-strip-ts"     => \$no_strip_ts,
	"verbose"         => \$verbose,
	"version"         => \$version,
	)) {
	print STDERR "\n";
	print STDERR "ERROR processing command line options\n";
	print STDERR "\n";
	print STDERR "For help, type '$script_name --help'\n";
	print STDERR "\n";

	exit $EX_OK;
}


if ($no_strip_ts) {
	$strip_ts = 1;
	$no_strip_ts = 0;
} else {
	$strip_ts = 0;
	$no_strip_ts = 1;
}


# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if ($help){

	&usage;

	exit $EX_OK;
}


# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

if ($version) {
	print STDERR "\n$script_name  $VUFX\n\n";
	print STDERR "\n";

	exit $EX_OK;
}


# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if ($#ARGV != 0) {

	# Limit input files to exactly one.
	#
	# 'while ($line = <ARGV>) {' in the code below supports multiple file
	# names on the command line, but the EXPECT statistics are reported
	# once for all input - it is not an expected use case to generate one
	# set of statistics for multiple input files.

	print STDERR "\n";
	print STDERR "Required arguments: CONSOLE_LOG\n";
	print STDERR "\n";

	exit $EX_USAGE;
}


#______________________________________________________________________________

# Patterns to match 'EXPECT \ : ' (begin) and 'EXPECT / : ' (end)
#
# $exp_* are used as regex match patterns,
# so '\\\\' in $exp_begin matches a single '\'
# quotemeta() does not do the right thing in this case
#
# $pr_fmt is the prefix that unittest prints for every message

$pr_fmt = "### dt-test ### ";
$exp_begin = "${pr_fmt}EXPECT \\\\ : ";
$exp_end   = "${pr_fmt}EXPECT / : ";
$expnot_begin = "${pr_fmt}EXPECT_NOT \\\\ : ";
$expnot_end   = "${pr_fmt}EXPECT_NOT / : ";


$line_num = "";
$timestamp = "";

LINE:
while ($line = <ARGV>) {

	chomp $line;

	$suppress_line = 0;

	$prefix = "  ";  ## 2 characters


	if ($strip_ts) {

		$timestamp = $line;

		if ($timestamp =~ /^\[\s*[0-9]+\.[0-9]*\] /) {
			($timestamp, $null) = split(/]/, $line);
			$timestamp = $timestamp . "] ";

		} else {
			$timestamp = "";
		}
	}

	$line =~ s/^\[\s*[0-9]+\.[0-9]*\] //;


	# -----  find EXPECT begin

	if ($line =~ /^\s*$exp_begin/) {
		$data = $line;
		$data =~ s/^\s*$exp_begin//;
		push @exp_begin_stack, $data;

		if ($verbose) {
			if ($print_line_num) {
				$line_num = sprintf("%4s ", $.);
			}
			printf "%s %s%s%s\n", $prefix, $line_num,  $timestamp, $line;
		}

		next LINE;
	}


	# -----  find EXPECT end

	if ($line =~ /^\s*$exp_end/) {
		$data = $line;
		$data =~ s/^\s*$exp_end//;

		if ($verbose) {
			if ($print_line_num) {
				$line_num = sprintf("%4s ", $.);
			}
			printf "%s %s%s%s\n", $prefix, $line_num,  $timestamp, $line;
		}

		$found = 0;
		$no_begin = 0;
		if (@exp_found_or_begin > 0) {
			$begin = pop @exp_found_or_begin;
			if (compare($data, $begin)) {
				$found = 1;
				$exp_found++;
			}
		} elsif (@begin > 0) {
			$begin = pop @exp_begin_stack;
		} else {
			$no_begin = 1;
		}

		if ($no_begin) {

			$exp_missing_begin++;
			print "** ERROR: EXPECT end without matching EXPECT begin:\n";
			print "       end ---> $line\n";

		} elsif (! $found) {

			if ($print_line_num) {
				$line_num = sprintf("%4s ", $.);
			}

			$exp_missing++;
			printf "** %s%s$script_name WARNING - not found ---> %s\n",
					$line_num,  $timestamp, $data;

		} elsif (! compare($data, $begin) and ($data ne $begin)) {

			$exp_missing_end++;
			print "** ERROR: EXPECT end does not match EXPECT begin:\n";
			print "       begin -> $begin\n";
			print "       end ---> $line\n";

		}

		next LINE;
	}


	# -----  find EXPECT_NOT begin

	if ($line =~ /^\s*$expnot_begin/) {
		$data = $line;
		$data =~ s/^\s*$expnot_begin//;
		push @expnot_begin_stack, $data;

		if ($verbose) {
			if ($print_line_num) {
				$line_num = sprintf("%4s ", $.);
			}
			printf "%s %s%s%s\n", $prefix, $line_num,  $timestamp, $line;
		}

		next LINE;
	}


	# -----  find EXPECT_NOT end

	if ($line =~ /^\s*$expnot_end/) {
		$data = $line;
		$data =~ s/^\s*$expnot_end//;

		if ($verbose) {
			if ($print_line_num) {
				$line_num = sprintf("%4s ", $.);
			}
			printf "%s %s%s%s\n", $prefix, $line_num,  $timestamp, $line;
		}

		$found = 0;
		$no_begin = 0;
		if (@expnot_found_or_begin > 0) {
			$begin = pop @expnot_found_or_begin;
			if (compare($data, $begin)) {
				$found = 1;
				$expnot_found++;
			}
		} elsif (@expnot_begin_stack <= 0) {
			$no_begin = 1;
		}

		if ($no_begin) {

			$expnot_missing_begin++;
			print "** ERROR: EXPECT_NOT end without matching EXPECT_NOT begin:\n";
			print "       end ---> $line\n";

		}

		if ($found) {

			if ($print_line_num) {
				$line_num = sprintf("%4s ", $.);
			}

			printf "** %s%s$script_name WARNING - next line matches EXPECT_NOT\n",
					$line_num,  $timestamp;
			printf "** %s%s%s\n", $line_num,  $timestamp, $line;

		} else {

			$expnot_missing++;

		}

		if (@expnot_begin_stack > 0) {
			$begin = pop @expnot_begin_stack;

			if (! compare($data, $begin) and ($data ne $begin)) {

				$expnot_missing_end++;
				print "** ERROR: EXPECT_NOT end does not match EXPECT_NOT begin:\n";
				print "       begin -> $begin\n";
				print "       end ---> $line\n";

			}
		}

		next LINE;
	}


	# -----  not an EXPECT line

	if (($line =~ /^${pr_fmt}start of unittest - you will see error messages$/) ||
	    ($line =~ /^${pr_fmt}end of unittest - [0-9]+ passed, [0-9]+ failed$/ )   ) {
		$prefix = "->"; # 2 characters
	} elsif ($line =~ /^${pr_fmt}FAIL /) {
		$unittest_fail++;
		$prefix = ">>"; # 2 characters
	}

	$found = 0;
	foreach $begin (@exp_begin_stack) {
		if (compare($begin, $line)) {
			$found = 1;
			last;
		}
	}

	if ($found) {
		$begin = shift @exp_begin_stack;
		while (! compare($begin, $line)) {
			push @exp_found_or_begin, $begin;
			$begin = shift @exp_begin_stack;
		}
		push @exp_found_or_begin, $line;

		if ($hide_expect) {
			$suppress_line = 1;
		}
		$prefix = "ok"; # 2 characters
	}


	$found = 0;
	foreach $begin (@expnot_begin_stack) {
		if (compare($begin, $line)) {
			$found = 1;
			last;
		}
	}

	if ($found) {
		$begin = shift @begin;
		while (! compare($begin, $line)) {
			push @expnot_found_or_begin, $begin;
			$begin = shift @begin;
		}
		push @expnot_found_or_begin, $line;

		if ($hide_expect) {
			$suppress_line = 1;
		}
		$prefix = "**"; # 2 characters
	}


	if ($suppress_line) {
		next LINE;
	}

	if ($print_line_num) {
		$line_num = sprintf("%4s ", $.);
	}

	printf "%s %s%s%s\n", $prefix, $line_num,  $timestamp, $line;
}

if (! $no_expect_stats) {
	print  "\n";
	print  "** EXPECT statistics:\n";
	print  "**\n";
	printf "**   non-zero values expected:\n";
	print  "**\n";
	printf "**     EXPECT found              : %4i\n", $exp_found;
	printf "**     EXPECT_NOT not found      : %4i\n", $expnot_missing;
	print  "**\n";
	printf "**   zero values expected:\n";
	print  "**\n";
	printf "**     EXPECT not found          : %4i\n", $exp_missing;
	printf "**     missing EXPECT begin      : %4i\n", $exp_missing_begin;
	printf "**     missing EXPECT end        : %4i\n", $exp_missing_end;
	print  "**\n";
	printf "**     EXPECT_NOT found          : %4i\n", $expnot_found;
	printf "**     missing EXPECT_NOT begin  : %4i\n", $expnot_missing_begin;
	printf "**     missing EXPECT_NOT end    : %4i\n", $expnot_missing_end;
	print  "**\n";
	printf "**     unittest FAIL             : %4i\n", $unittest_fail;
	printf "**     internal error            : %4i\n", $internal_err;
}

if (@exp_begin_stack) {
	print "** ERROR: EXPECT begin without matching EXPECT end:\n";
	print "          This list may be misleading.\n";
	foreach $begin (@exp_begin_stack) {
		print "       begin ---> $begin\n";
	}
}

if (@expnot_begin_stack) {
	print "** ERROR: EXPECT_NOT begin without matching EXPECT_NOT end:\n";
	print "          This list may be misleading.\n";
	foreach $begin (@expnot_begin_stack) {
		print "       begin ---> $begin\n";
	}
}
¿Qué es la limpieza dental de perros? - Clínica veterinaria


Es la eliminación del sarro y la placa adherida a la superficie de los dientes mediante un equipo de ultrasonidos que garantiza la integridad de las piezas dentales a la vez que elimina en profundidad cualquier resto de suciedad.

A continuación se procede al pulido de los dientes mediante una fresa especial que elimina la placa bacteriana y devuelve a los dientes el aspecto sano que deben tener.

Una vez terminado todo el proceso, se mantiene al perro en observación hasta que se despierta de la anestesia, bajo la atenta supervisión de un veterinario.

¿Cada cuánto tiempo tengo que hacerle una limpieza dental a mi perro?

A partir de cierta edad, los perros pueden necesitar una limpieza dental anual o bianual. Depende de cada caso. En líneas generales, puede decirse que los perros de razas pequeñas suelen acumular más sarro y suelen necesitar una atención mayor en cuanto a higiene dental.


Riesgos de una mala higiene


Los riesgos más evidentes de una mala higiene dental en los perros son los siguientes:

  • Cuando la acumulación de sarro no se trata, se puede producir una inflamación y retracción de las encías que puede descalzar el diente y provocar caídas.
  • Mal aliento (halitosis).
  • Sarro perros
  • Puede ir a más
  • Las bacterias de la placa pueden trasladarse a través del torrente circulatorio a órganos vitales como el corazón ocasionando problemas de endocarditis en las válvulas. Las bacterias pueden incluso acantonarse en huesos (La osteomielitis es la infección ósea, tanto cortical como medular) provocando mucho dolor y una artritis séptica).

¿Cómo se forma el sarro?

El sarro es la calcificación de la placa dental. Los restos de alimentos, junto con las bacterias presentes en la boca, van a formar la placa bacteriana o placa dental. Si la placa no se retira, al mezclarse con la saliva y los minerales presentes en ella, reaccionará formando una costra. La placa se calcifica y se forma el sarro.

El sarro, cuando se forma, es de color blanquecino pero a medida que pasa el tiempo se va poniendo amarillo y luego marrón.

Síntomas de una pobre higiene dental
La señal más obvia de una mala salud dental canina es el mal aliento.

Sin embargo, a veces no es tan fácil de detectar
Y hay perros que no se dejan abrir la boca por su dueño. Por ejemplo…

Recientemente nos trajeron a la clínica a un perro que parpadeaba de un ojo y decía su dueño que le picaba un lado de la cara. Tenía molestias y dificultad para comer, lo que había llevado a sus dueños a comprarle comida blanda (que suele ser un poco más cara y llevar más contenido en grasa) durante medio año. Después de una exploración oftalmológica, nos dimos cuenta de que el ojo tenía una úlcera en la córnea probablemente de rascarse . Además, el canto lateral del ojo estaba inflamado. Tenía lo que en humanos llamamos flemón pero como era un perro de pelo largo, no se le notaba a simple vista. Al abrirle la boca nos llamó la atención el ver una muela llena de sarro. Le realizamos una radiografía y encontramos una fístula que llegaba hasta la parte inferior del ojo.

Le tuvimos que extraer la muela. Tras esto, el ojo se curó completamente con unos colirios y una lentilla protectora de úlcera. Afortunadamente, la úlcera no profundizó y no perforó el ojo. Ahora el perro come perfectamente a pesar de haber perdido una muela.

¿Cómo mantener la higiene dental de tu perro?
Hay varias maneras de prevenir problemas derivados de la salud dental de tu perro.

Limpiezas de dientes en casa
Es recomendable limpiar los dientes de tu perro semanal o diariamente si se puede. Existe una gran variedad de productos que se pueden utilizar:

Pastas de dientes.
Cepillos de dientes o dedales para el dedo índice, que hacen más fácil la limpieza.
Colutorios para echar en agua de bebida o directamente sobre el diente en líquido o en spray.

En la Clínica Tus Veterinarios enseñamos a nuestros clientes a tomar el hábito de limpiar los dientes de sus perros desde que son cachorros. Esto responde a nuestro compromiso con la prevención de enfermedades caninas.

Hoy en día tenemos muchos clientes que limpian los dientes todos los días a su mascota, y como resultado, se ahorran el dinero de hacer limpiezas dentales profesionales y consiguen una mejor salud de su perro.


Limpiezas dentales profesionales de perros y gatos

Recomendamos hacer una limpieza dental especializada anualmente. La realizamos con un aparato de ultrasonidos que utiliza agua para quitar el sarro. Después, procedemos a pulir los dientes con un cepillo de alta velocidad y una pasta especial. Hacemos esto para proteger el esmalte.

La frecuencia de limpiezas dentales necesaria varía mucho entre razas. En general, las razas grandes tienen buena calidad de esmalte, por lo que no necesitan hacerlo tan a menudo e incluso pueden pasarse la vida sin requerir una limpieza. Sin embargo, razas pequeñas como el Yorkshire o el Maltés, deben hacérselas todos los años desde cachorros si se quiere conservar sus piezas dentales.

Otro factor fundamental es la calidad del pienso. Algunas marcas han diseñado croquetas que limpian la superficie del diente y de la muela al masticarse.

Ultrasonido para perros

¿Se necesita anestesia para las limpiezas dentales de perros y gatos?

La limpieza dental en perros no es una técnica que pueda practicarse sin anestesia general , aunque hay veces que los propietarios no quieren anestesiar y si tiene poco sarro y el perro es muy bueno se puede intentar…… , pero no se va a poder pulir ni acceder a todas la zona de la boca …. Además los limpiadores dentales van a irrigar agua y hay riesgo de aspiración a vías respiratorias si no se realiza una anestesia correcta con intubación traqueal . En resumen , sin anestesia no se va hacer una correcta limpieza dental.

Tampoco sirve la sedación ya que necesitamos que el animal esté totalmente quieto, y el veterinario tenga un acceso completo a todas sus piezas dentales y encías.

Alimentos para la limpieza dental

Hay que tener cierto cuidado a la hora de comprar determinados alimentos porque no todos son saludables. Algunos tienen demasiado contenido graso, que en exceso puede causar problemas cardiovasculares y obesidad.

Los mejores alimentos para los dientes son aquellos que están elaborados por empresas farmacéuticas y llevan componentes químicos con tratamientos específicos para el diente del perro. Esto implica no solo limpieza a través de la acción mecánica de morder sino también un tratamiento antibacteriano para prevenir el sarro.

Conclusión

Si eres como la mayoría de dueños, por falta de tiempo , es probable que no estés prestando la suficiente atención a la limpieza dental de tu perro. Por eso te animamos a que comiences a limpiar los dientes de tu perro y consideres atender a su higiene bucal con frecuencia.

Estas simples medidas pueden conllevar a que tu perro tenga una vida más larga y mucho más saludable.

Si te resulta imposible introducir un cepillo de dientes a tu perro en la boca, pásate con él por clínica Tus Veterinarios y te explicamos cómo hacerlo.

Necesitas hacer una limpieza dental profesional a tu mascota?
Llámanos al 622575274 o contacta con nosotros

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

¡Hola!