---
name: "function::assert"
section: "3stap"
platform: "linux"
package: "systemtap-doc"
version: "5.1-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/function::assert"
---

# function::assert(3stap)

evaluate assertion

## NAME

function::assert - evaluate assertion

## SYNOPSIS

```
1) assert(expression:long)
```

```
2) assert(expression:long,msg:string)
```

## ARGUMENTS

*expression*

The expression to evaluate

*msg*

The formatted message string

## DESCRIPTION

1\) This function checks the expression and aborts the current running probe if expression evaluates to zero. Uses**error** and may be caught by try{} catch{}. A default message will be displayed.

2\) This function checks the expression and aborts the current running probe if expression evaluates to zero. Uses**error** and may be caught by try{} catch{}. The specified message will be displayed.

## SEE ALSO0

[*tapset::logging*(3stap)](/tapset::logging/3stap.md)
